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

Replacing available commands with basic and advanced commands #2167

Merged

Conversation

ayushgml
Copy link
Contributor

This pull request closes:

Changes made:

  • Added "github.com/spf13/pflag" package to the project dependencies.
  • Divided the available command list into two - Basic and Advanced commands
  • added the custom help function output using SetHelpFunc
  • added a function printCommands to print all the commands. Used the function in SetHelpFunc.

Output of limactl help after changes:

Lima: Linux virtual machines

Usage:
  limactl [command]

Examples:
  Start the default instance:
  $ limactl start

  Open a shell:
  $ lima

  Run a container:
  $ lima nerdctl run -d --name nginx -p 8080:80 nginx:alpine

  Stop the default instance:
  $ limactl stop

  See also template YAMLs: /usr/local/share/lima/templates

Basic Commands:
  create          Create an instance of Lima
  delete          Delete an instance of Lima.
  edit            Edit an instance of Lima
  list            List instances of Lima.
  shell           Execute shell in Lima
  start           Start an instance of Lima
  stop            Stop an instance

Advanced Commands:
  copy            Copy files between host and guest
  disk            Lima disk management
  factory-reset   Factory reset an instance of Lima
  info            Show diagnostic information
  protect         Protect an instance to prohibit accidental removal
  prune           Prune garbage objects
  show-ssh        Show the ssh command line (DEPRECATED; use `ssh -F` instead)
  snapshot        Manage instance snapshots
  sudoers         Generate the content of the /etc/sudoers.d/lima file
  unprotect       Unprotect an instance
  validate        Validate YAML files

Flags:
  --debug           debug mode
  --help            help for limactl
  --log-level       Set the logging level [trace, debug, info, warn, error]
  --tty             Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation.
  --version         version for limactl

Use "limactl [command] --help" for more information about a command.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

@AkihiroSuda AkihiroSuda added the area/cli limactl CLI user experience label Jan 27, 2024
@ayushgml
Copy link
Contributor Author

ayushgml commented Jan 27, 2024

Sorry @AkihiroSuda! Now I made the necessary changes to implement the fix using groupID. I will define constants too

@ayushgml ayushgml force-pushed the split-help-to-basic-and-advanced branch from caa9319 to 9468823 Compare January 27, 2024 16:32
@@ -119,6 +123,7 @@ func newApp() *cobra.Command {
newProtectCommand(),
newUnprotectCommand(),
)

Copy link
Member

Choose a reason for hiding this comment

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

Unneeded change


Prefix guest filenames with the instance name and a colon.

Example: limactl copy default:/etc/os-release .
`
)
Copy link
Member

Choose a reason for hiding this comment

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

Unneeded changes

@AkihiroSuda
Copy link
Member

Thanks, but please squash commits

@ayushgml ayushgml force-pushed the split-help-to-basic-and-advanced branch from 9468823 to 5c46f0a Compare January 29, 2024 05:48
@ayushgml
Copy link
Contributor Author

Thanks, but please squash commits

Thank you for reviewing @AkihiroSuda. Now I have squashed the commits.

Signed-off-by: Ayush <ayush.gupta2020c@vitstudent.ac.in>
@ayushgml ayushgml force-pushed the split-help-to-basic-and-advanced branch from 5c46f0a to 1595639 Compare January 29, 2024 05:56
@AkihiroSuda AkihiroSuda added this to the v0.21.0 (tentative) milestone Jan 30, 2024
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit c339ef2 into lima-vm:master Jan 30, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli limactl CLI user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants