-
Notifications
You must be signed in to change notification settings - Fork 275
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
Subcommand aliases #281
Comments
Good idea! These would be easy to add. |
@phatblat I imagine so… although I haven't dug into Swift yet… If you point out where in the codebase, I can do a PR… |
This project uses Commandant and all the commands live in the Commands folder. I don't see an option in Commandant for creating a command alias. However, you could:
|
Add `i` alias for `install` command. See mas-cli#281.
Add `ls` alias for `list` command. See mas-cli#281.
Add `remove` alias for `uninstall` command. See mas-cli#281.
Add `rm` alias for `uninstall` command. See mas-cli#281.
@phatblat Ok, quickly done that for |
Add `update` alias for `brew upgrade mas`. See mas-cli#281.
the |
just copy over the command looks not good as coding style - i would create a wrapper command for alias and wrap them in this command - so no duplicate code is created see comment here: Carthage/Commandant#155 (comment) if the alias command not goes into commandant - we can add it anyway into the Note: duplicate code is bad, because if someone change the code most time they forget to edit the "copied" code part) |
@mas-cli/contributors Commandant is dormant, without updates for 4 years. Apple now provides the open source Swift Argument Processor, which supports aliases and is actively being developed. I imagine switching shouldn't be hard. Is it OK to switch? Various other command line issues exist, like validating arguments, improving help messages, and generating bash, zsh, and fish completion scripts. It probably makes sense to switch over ASAP, so we don't do unnecessary work that will either need to be redone or that Swift Argument Parser can automatically do for us. Does anyone disagree? Are there other better frameworks? |
@mas-cli/admins I've locally refactored mas to use SAP instead of Commandant. To get everything working, I moved everything from Is there any need to retain MasKit, given that I got testing to work without a separate library? Is it OK to have upgraded swift-tools-version from 5.3 to 5.5? I also had to remove swift-format from the dependencies because that forced an older version of Swift Argument Parser. The code doesn't use swift-format; it is only used by the lint & the format scripts. I switched it to just running |
The main reason most of the |
@phatblat I've already moved all the mas code into the I've already switched from Commandant to Swift Argument Parser. I haven't created any new aliases yet, though they're easy to add in Swift Argument Parser. Was waiting to have a complete list of aliases drafted here. One preference: I'd like to rename |
Renaming |
IIRC, homebrew-bundle uses
|
Is your feature request related to a problem? Please describe.
mas
could use a few aliases, to bring it more in line withbrew
andcask
…Describe the solution you'd like
These could include:
mas -v
/--version
->mas version
mas -h
/--help
->mas help
mas ls
->mas list
mas i
->mas install
mas rm
->mas uninstall
mas upgrade
->mas update
mas purchase
->mas install <with arguments>
(afterinstall
is updated to "purchase")mas signin
->mas sign-in
mas signout
->mas sign-out
REJECTED:
mas update
->brew upgrade mas
The text was updated successfully, but these errors were encountered: