Display fields with more than 1 value (p.e ip4_addr), line separator between jails

This commit is contained in:
yo
2021-12-19 14:31:51 +01:00
parent 4eeb6d0d99
commit c1771153d6
2 changed files with 79 additions and 11 deletions

View File

@ -20,6 +20,7 @@ var (
gConfigFile string
gDisplayColumns string
gNoLineSep bool
rootCmd = & cobra.Command{
@ -76,6 +77,7 @@ func init() {
// Command dependant switches
listCmd.PersistentFlags().StringVarP(&gDisplayColumns, "outcol", "o", "JID,Name,Config.Release,Config.Ip4_addr,Running", "Show these columns in output")
listCmd.PersistentFlags().BoolVarP(&gNoLineSep, "nolinesep", "l", false, "Do not display line separator between jails")
/* searchComputerCmd.PersistentFlags().BoolVarP(&gShowAccount, "show-account", "c", false, "Show account when listing computer")
searchComputerCmd.PersistentFlags().BoolVarP(&gDisplayAsCSV, "csv-format", "v", false, "Show results in CSV (separator = ';')")
*/
@ -112,6 +114,9 @@ func initConfig() {
if false == listCmd.Flags().Lookup("outcol").Changed {
gDisplayColumns = viper.GetString("outcol")
}
if false == listCmd.Flags().Lookup("nolinesep").Changed {
gNoLineSep = viper.GetBool("nolinesep")
}
}
func Execute() {