Skip to content

Request: Don't require quotes around the prompt #5

Closed

Description

@ndbroadbent

Would it be possible to accept multiple CLI arguments and join them together? Needing to wrap the prompt in quotes is a little bit annoying, and it would be nice to just type plz and then keep typing the prompt without quotes. E.g. plz checkout main instead of plz 'checkout main'.

Another thing that would be nice is to run the generated program by just pressing "enter" (instead of needing to press "y".) Cancelling can be done with Ctrl+C or by pressing "n", so it would be nice to default to "y"

Activity

  1. m1guelpf commented on Dec 16, 2022

    @m1guelpf
    Owner

    If you don't type "y" and just press enter, it'll run the program. As for the quotes, I haven't been able to figure it out, but would welcome a PR that adds that.

  2. added
    enhancement
    help wanted
    good first issue
    on Dec 16, 2022
  3. ndbroadbent commented on Dec 16, 2022

    @ndbroadbent
    ContributorAuthor

    Oh thanks, not sure how I missed that. Yes just pressing enter already works. I can look into the quotes issue.

    Another thing is that it would be nice to make it aware of the OS, so that it knows how to install programs on Linux vs Mac, etc. Example I ran into:

    $ plz 'install cowsay'
    ✔ Got some code!
    ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    sudo apt-get install cowsay
    ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    >> Run the generated program? [Y/n]
    ✖ The program threw an error.
    sudo: apt-get: command not found
    
    $ plz 'install cowsay on mac'
    ✔ Got some code!
    ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    brew install cowsay
    ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    >> Run the generated program? [Y/n]
    ✔ Command ran successfully
    ==> Fetching cowsay
    ...
    

    It would be cool to add a prefix to the prompt that tells it I'm on a Mac

  4. ndbroadbent commented on Dec 16, 2022

    @ndbroadbent
    ContributorAuthor

    I managed to figure it out and opened a PR: #6

    Apparently Rust and Clap are able to automatically figure it out just by changing String to Vec<String>

  5. m1guelpf commented on Dec 16, 2022

    @m1guelpf
    Owner

    Could you open another issue for the OS prefix?

  6. ndbroadbent commented on Dec 16, 2022

    @ndbroadbent
    ContributorAuthor

    Could you open another issue for the OS prefix?

    I opened a PR here: #7
    Just rebased it as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions