Skip to content
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

make it possible to use flags like '-sdp' as verb #874

Merged
merged 4 commits into from
May 4, 2024
Merged

make it possible to use flags like '-sdp' as verb #874

merged 4 commits into from
May 4, 2024

Conversation

Canop
Copy link
Owner

@Canop Canop commented Apr 30, 2024

For example, to show dates and permissions:
image

Opinions on this feature welcome.

@Canop Canop marked this pull request as draft April 30, 2024 20:02
@Canop Canop marked this pull request as ready for review May 1, 2024 12:26
@Canop
Copy link
Owner Author

Canop commented May 1, 2024

With this PR comes a new verb invocation syntax, allowing to have verb with name such "-".

Here's the doc:

    /// Examples:
    ///  "mv"       -> name: "mv"
    ///  "!mv"      -> name: "mv", bang
    ///  "mv a b"   -> name: "mv", args: "a b"
    ///  "mv!a b"   -> name: "mv", args: "a b", bang
    ///  "a-b  c"   -> name: "a-b", args: "c", bang
    ///  "-sp"      -> name: "-", args: "sp"
    ///  "-a b"     -> name: "-", args: "a b"
    ///  "-a b"     -> name: "-", args: "a b"
    ///  "--a"      -> name: "--", args: "a"
    ///
    /// Notes:
    /// 1. A name is either "special" (only made of non alpha characters)
    ///    or normal (starting with an alpha character). Special names don't
    ///    need a space afterwards, as the first alpha character will start
    ///    the args.
    /// 2. The space or colon after the name is optional if there's a bang
    ///    after the name: the bang is the separator.
    /// 3. Duplicate separators before args are ignored (they're usually typos)
    /// 4. An opening parenthesis starts args

@Canop Canop merged commit 3c3f4e6 into main May 4, 2024
1 check passed
@Canop Canop deleted the dash-flags branch May 4, 2024 12:24
@FrancescElies
Copy link
Contributor

This is useful, thanks!

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.

2 participants