mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	feat(aliases): add aliases for nodes command
				
					
				
			- `node`, `machine`, `machines` are aliases for `nodes` command - `ls`, `show` aliases for `list` subcommand - `logout`, `exp`, `e` are aliases for `expire` subcommand - `del` is an alias for `delete` subcommand
This commit is contained in:
		
							parent
							
								
									dbb2af0238
								
							
						
					
					
						commit
						21eee912a3
					
				| @ -51,6 +51,7 @@ func init() { | |||||||
| var nodeCmd = &cobra.Command{ | var nodeCmd = &cobra.Command{ | ||||||
| 	Use:     "nodes", | 	Use:     "nodes", | ||||||
| 	Short:   "Manage the nodes of Headscale", | 	Short:   "Manage the nodes of Headscale", | ||||||
|  | 	Aliases: []string{"node", "machine", "machines"}, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| var registerNodeCmd = &cobra.Command{ | var registerNodeCmd = &cobra.Command{ | ||||||
| @ -106,6 +107,7 @@ var registerNodeCmd = &cobra.Command{ | |||||||
| var listNodesCmd = &cobra.Command{ | var listNodesCmd = &cobra.Command{ | ||||||
| 	Use:     "list", | 	Use:     "list", | ||||||
| 	Short:   "List nodes", | 	Short:   "List nodes", | ||||||
|  | 	Aliases: []string{"ls", "show"}, | ||||||
| 	Run: func(cmd *cobra.Command, args []string) { | 	Run: func(cmd *cobra.Command, args []string) { | ||||||
| 		output, _ := cmd.Flags().GetString("output") | 		output, _ := cmd.Flags().GetString("output") | ||||||
| 		namespace, err := cmd.Flags().GetString("namespace") | 		namespace, err := cmd.Flags().GetString("namespace") | ||||||
| @ -164,7 +166,7 @@ var expireNodeCmd = &cobra.Command{ | |||||||
| 	Use:     "expire", | 	Use:     "expire", | ||||||
| 	Short:   "Expire (log out) a machine in your network", | 	Short:   "Expire (log out) a machine in your network", | ||||||
| 	Long:    "Expiring a node will keep the node in the database and force it to reauthenticate.", | 	Long:    "Expiring a node will keep the node in the database and force it to reauthenticate.", | ||||||
| 	Aliases: []string{"logout"}, | 	Aliases: []string{"logout", "exp", "e"}, | ||||||
| 	Run: func(cmd *cobra.Command, args []string) { | 	Run: func(cmd *cobra.Command, args []string) { | ||||||
| 		output, _ := cmd.Flags().GetString("output") | 		output, _ := cmd.Flags().GetString("output") | ||||||
| 
 | 
 | ||||||
| @ -208,6 +210,7 @@ var expireNodeCmd = &cobra.Command{ | |||||||
| var deleteNodeCmd = &cobra.Command{ | var deleteNodeCmd = &cobra.Command{ | ||||||
| 	Use:     "delete", | 	Use:     "delete", | ||||||
| 	Short:   "Delete a node", | 	Short:   "Delete a node", | ||||||
|  | 	Aliases: []string{"del"}, | ||||||
| 	Run: func(cmd *cobra.Command, args []string) { | 	Run: func(cmd *cobra.Command, args []string) { | ||||||
| 		output, _ := cmd.Flags().GetString("output") | 		output, _ := cmd.Flags().GetString("output") | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user