add --mime-type(-m) to ls in the type column#7616
Merged
fdncred merged 1 commit intonushell:mainfrom Dec 27, 2022
fdncred:add_mime_type_to_ls
Merged
add --mime-type(-m) to ls in the type column#7616fdncred merged 1 commit intonushell:mainfrom fdncred:add_mime_type_to_ls
--mime-type(-m) to ls in the type column#7616fdncred merged 1 commit intonushell:mainfrom
fdncred:add_mime_type_to_ls
Conversation
sholderbach
added a commit
to nushell/nushell.github.io
that referenced
this pull request
Dec 27, 2022
sholderbach
added a commit
to nushell/nushell.github.io
that referenced
this pull request
Jan 10, 2023
* [WIP] Release notes for `0.74` Please add your important new features and breaking changes to the release notes by committing to/opening a PR against the `release-notes-0.73` branch. Thank you! * Start work on 0.74 release notes * Mention mimetype flag from Darren Refer to nushell/nushell#7616 * Update 2023-01-10-nushell_0_74.md * Add image; Fmt (#718) * Update 2023-01-10-nushell_0_74.md * type-o * Update 2023-01-10-nushell_0_74.md * Add webbedspace's changes (#727) * Add hide command breaking change * Remove broken PATH mention The PR changing append/prepend commands was reverted. * Add `math eval` removal * Mention `url encode` * Mention get/select changes in breaking changes * update changelog (#733) * Update 2023-01-10-nushell_0_74.md * Add new book chapter note * Refactor breaking changes * Update 2023-01-10-nushell_0_74.md * Add detailed changelog * Update excerpt Co-authored-by: Jakub Žádník <kubouch@gmail.com> Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com> Co-authored-by: Leon <L_1_L_0@yahoo.com> Co-authored-by: Reilly Wood <26268125+rgwood@users.noreply.github.com> Co-authored-by: WindSoilder <WindSoilder@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the

mime-typeto thetypecolumn if you add the--mime-type(-m)flag tols.User-Facing Changes
If you specify the
-mflag, you get the "guessed at" mime type. The guess is based on the file name and uses this crate https://docs.rs/mime_guess/latest/mime_guess/ for the guessing.Part of issue #7612 and and #7524
There's some debate on if the
mime-typeshould be added to thetypecolumn or if there should be a separatemimecolumn. I tend to lean on the side oftypesince it's technically a type and it's only in that column if you ask it to be there. Also, I'd prefer to reuse a column rather than having a list of sprawling columns. Also, as @KodiCraft suggested, there is precedence as withls -dwhere the summed size is in the size column.I could go either way and if someone wants to create a
mimecolumn, we'd probably accept it.Tests + Formatting
Don't forget to add tests that cover your changes.
Make sure you've run and fixed any issues with these commands:
cargo fmt --all -- --checkto check standard code formatting (cargo fmt --allapplies these changes)cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collectto check that you're using the standard code stylecargo test --workspaceto check that all tests passAfter Submitting
If your PR had any user-facing changes, update the documentation after the PR is merged, if necessary. This will help us keep the docs up to date.