Skip to content

feat(broot): add broot spec #1648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 16, 2022
Merged

feat(broot): add broot spec #1648

merged 3 commits into from
Oct 16, 2022

Conversation

Pooja444
Copy link
Contributor

@Pooja444 Pooja444 commented Oct 14, 2022

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
New spec for broot

What is the current behavior? (You can also link to an open issue here)
Missing spec for broot (closes #1526)

What is the new behavior (if this is a feature change)?
Add spec for broot

Additional info:

  • Ran npm run test and npm run lint:fix before raising PR
  • Tested this spec locally, autocomplete is working correctly

@withfig-bot
Copy link
Collaborator

Overview

src/broot.ts:

Info:

src/br.ts:

Info:

@withfig-bot
Copy link
Collaborator

Hello @Pooja444,
thank you very much for creating a Pull Request!
Here is a small checklist to get this PR merged as quickly as possible:

  • Do all subcommands / options which take arguments include the args property (args: {})?
  • Are all options modular? E.g. -a -u -x instead of -aux
  • Have all other checks passed?

Please add a 👍 as a reaction to this comment to show that you read this.

Copy link
Contributor

@clo4 clo4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pooja444 thank you for the PR! Beautifully done.

This is embarrassing: I ran broot --help instead of looking at the man-page and... there's actually a bunch more options that I didn't know about 🤦 Would you be able to add those?

If you're short on time, I'm happy to land this PR as-is and we can add the rest later. What you've got is perfect and would be ready to merge.

broot 1.16.0
dystroy <denys.seguret@gmail.com>
A tree explorer and a customizable launcher

Complete documentation lives at https://dystroy.org/broot"

USAGE:
    broot [OPTIONS] [FILE]

ARGS:
    <FILE>
            Root Directory

OPTIONS:
    -c, --cmd <CMD>
            Semicolon separated commands to execute

        --color <COLOR>
            Whether to have styles and colors (auto is default and usually OK)
            
            [default: auto]
            [possible values: auto, yes, no]

        --conf <CONF>
            Semicolon separated paths to specific config files"),

    -d, --dates
            Show the last modified date of files and directories"

    -D, --no-dates
            Don't show the last modified date"

    -f, --only-folders
            Only show folders

    -F, --no-only-folders
            Show folders and files alike

    -g, --show-git-info
            Show git statuses on files and stats on repo

    -G, --no-show-git-info
            Don't show git statuses on files and stats on repo

        --get-root
            Ask for the current root of the remote broot

        --git-status
            Only show files having an interesting git status, including hidden ones

    -h, --hidden
            Show hidden files

    -H, --no-hidden
            Don't show hidden files

        --height <HEIGHT>
            Height (if you don't want to fill the screen or for file export)

        --help
            Print help information

    -i, --git-ignored
            Show git ignored files

    -I, --no-git-ignored
            Don't show git ignored files

        --install
            Install or reinstall the br shell function

        --listen <LISTEN>
            A socket to listen to for commands

        --no-sort
            Don't sort

        --outcmd <OUTCMD>
            Where to write the produced cmd (if any)

    -p, --permissions
            Show permissions

    -P, --no-permissions
            Don't show permissions

        --print-shell-function <PRINT_SHELL_FUNCTION>
            Print to stdout the br function for a given shell

    -s, --sizes
            Show the size of files and directories

    -S, --no-sizes
            Don't show sizes

        --send <SEND>
            A socket that broot sends commands to before quitting

        --set-install-state <SET_INSTALL_STATE>
            Where to write the produced cmd (if any)
            
            [possible values: undefined, refused, installed]

        --show-root-fs
            Show filesystem info on top

        --sort-by-count
            Sort by count (only show one level of the tree)

        --sort-by-date
            Sort by date (only show one level of the tree)

        --sort-by-size
            Sort by size (only show one level of the tree)

        --sort-by-type
            Same as sort-by-type-dirs-first

        --sort-by-type-dirs-first
            Sort by type, directories first (only show one level of the tree)

        --sort-by-type-dirs-last
            Sort by type, directories last (only show one level of the tree)

    -t, --trim-root
            Trim the root too and don't show a scrollbar

    -T, --no-trim-root
            Don't trim the root level, show a scrollbar

    -V, --version
            Print version information

    -w, --whale-spotting
            Sort by size, show ignored and hidden files

        --write-default-conf <WRITE_DEFAULT_CONF>
            Write default conf files in given directory

@Pooja444
Copy link
Contributor Author

@separaterecords oh hahhhaha I had no idea! Sorry I missed that, I'll add it tomorrow morning (Pacific time zone) and update the PR asap, does that sound good? 🙂

@clo4
Copy link
Contributor

clo4 commented Oct 14, 2022

Sounds great to me! No rush at all. Thank you again for working on this!

@clo4
Copy link
Contributor

clo4 commented Oct 14, 2022

(and sorry for not checking this beforehand!)

@Pooja444
Copy link
Contributor Author

@separaterecords I have added the rest of the options and args, please let me know if it looks good, thanks a lot!

@Pooja444 Pooja444 requested a review from clo4 October 14, 2022 18:54
Copy link
Contributor

@fedeci fedeci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, it looks great! Can you address the comments please?

src/broot.ts Outdated
Comment on lines 6 to 13
{
name: ["--dates", "-d"],
description: "Show the last modified date of files and directories",
},
{
name: ["--no-dates", "-D"],
description: "Don't show the last modified date",
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are mutually exclusiveOn. Same for all the other options that has a -- and a --no- version. Can you add that property?

name: ["--out", "-o"],
description: "Where to write the produced path, if any",
args: {
name: "file-export-path",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "file-export-path",
name: "file-export-path",
template: "filepaths",
suggestCurrentToken: true,

@Pooja444 Pooja444 requested review from fedeci and removed request for clo4 October 14, 2022 20:58
@Pooja444
Copy link
Contributor Author

Thanks for your suggestions @fedeci! I have updated my pull request as per your comments, please review and let me know if it looks good

Copy link
Contributor

@clo4 clo4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you @Pooja444 🙂

@clo4 clo4 merged commit 9ae5710 into withfig:master Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[broot] missing spec
4 participants