Loading go_port/cli_commands_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ func TestCLICommandsExposeExpectedFlags(t *testing.T) { "bundles-remove": {"directory"}, "feed": {"directory", "verbose"}, "sync": {"directory"}, "basex": {"directory"}, "basex": {"directory", "verbose"}, "templates-list": {"directory"}, "static-list": {"directory"}, "projects": {"json-out"}, Loading go_port/i18n.go +2 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ commandes new, projects et cache-clear qui peuvent être lancées aussi en dehor "flag.freeze.output": "Dossier de sortie des fichiers HTML", "flag.freeze.debug": "Debug", "flag.feed.verbose": "Afficher les commandes exécutées", "flag.basex.verbose": "Afficher la commande exécutée", "flag.projects.json_out": "Sortie JSON", "table.info.name": "Nom", Loading Loading @@ -165,6 +166,7 @@ which can also be run outside a MaX directory.`, "flag.freeze.output": "Output directory for HTML files", "flag.freeze.debug": "Debug", "flag.feed.verbose": "Show executed commands", "flag.basex.verbose": "Show executed command", "flag.projects.json_out": "JSON output", "table.info.name": "Name", Loading go_port/main.go +8 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ import ( //go:embed max_releases.json var fallbackReleases []byte const version = "0.3.0" const version = "0.3.1" const maxConfigFile = "config.xml" const baseXDistro = "https://files.basex.org/releases/11.7/BaseX117.zip" Loading Loading @@ -448,14 +448,16 @@ func newSyncCmd() *cobra.Command { func newBasexCmd() *cobra.Command { directory := cwd() verbose := false cmd := &cobra.Command{ Use: "basex", Short: T("cmd.basex.short"), RunE: func(cmd *cobra.Command, args []string) error { return runBasex(directory) return runBasex(directory, verbose) }, } cmd.Flags().StringVar(&directory, "directory", directory, T("flag.common.directory")) cmd.Flags().BoolVar(&verbose, "verbose", false, T("flag.basex.verbose")) return cmd } Loading Loading @@ -2355,7 +2357,7 @@ func runSync(directory string) error { return errors.New(T("err.no_max_use_new")) } func runBasex(directory string) error { func runBasex(directory string, verbose bool) error { abs, err := filepath.Abs(directory) if err != nil { return err Loading @@ -2374,6 +2376,9 @@ func runBasex(directory string) error { cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr cmd.Stdin = os.Stdin if verbose { fmt.Println(formatCommand(cmd)) } return cmd.Run() } Loading Loading
go_port/cli_commands_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ func TestCLICommandsExposeExpectedFlags(t *testing.T) { "bundles-remove": {"directory"}, "feed": {"directory", "verbose"}, "sync": {"directory"}, "basex": {"directory"}, "basex": {"directory", "verbose"}, "templates-list": {"directory"}, "static-list": {"directory"}, "projects": {"json-out"}, Loading
go_port/i18n.go +2 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ commandes new, projects et cache-clear qui peuvent être lancées aussi en dehor "flag.freeze.output": "Dossier de sortie des fichiers HTML", "flag.freeze.debug": "Debug", "flag.feed.verbose": "Afficher les commandes exécutées", "flag.basex.verbose": "Afficher la commande exécutée", "flag.projects.json_out": "Sortie JSON", "table.info.name": "Nom", Loading Loading @@ -165,6 +166,7 @@ which can also be run outside a MaX directory.`, "flag.freeze.output": "Output directory for HTML files", "flag.freeze.debug": "Debug", "flag.feed.verbose": "Show executed commands", "flag.basex.verbose": "Show executed command", "flag.projects.json_out": "JSON output", "table.info.name": "Name", Loading
go_port/main.go +8 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ import ( //go:embed max_releases.json var fallbackReleases []byte const version = "0.3.0" const version = "0.3.1" const maxConfigFile = "config.xml" const baseXDistro = "https://files.basex.org/releases/11.7/BaseX117.zip" Loading Loading @@ -448,14 +448,16 @@ func newSyncCmd() *cobra.Command { func newBasexCmd() *cobra.Command { directory := cwd() verbose := false cmd := &cobra.Command{ Use: "basex", Short: T("cmd.basex.short"), RunE: func(cmd *cobra.Command, args []string) error { return runBasex(directory) return runBasex(directory, verbose) }, } cmd.Flags().StringVar(&directory, "directory", directory, T("flag.common.directory")) cmd.Flags().BoolVar(&verbose, "verbose", false, T("flag.basex.verbose")) return cmd } Loading Loading @@ -2355,7 +2357,7 @@ func runSync(directory string) error { return errors.New(T("err.no_max_use_new")) } func runBasex(directory string) error { func runBasex(directory string, verbose bool) error { abs, err := filepath.Abs(directory) if err != nil { return err Loading @@ -2374,6 +2376,9 @@ func runBasex(directory string) error { cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr cmd.Stdin = os.Stdin if verbose { fmt.Println(formatCommand(cmd)) } return cmd.Run() } Loading