MCPcopy Create free account
hub / github.com/dropbox/dbxcli / newJSONHelpTestRoot

Function newJSONHelpTestRoot

cmd/help_json_test.go:884–960  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

882}
883
884func newJSONHelpTestRoot(t *testing.T) *cobra.Command {
885 t.Helper()
886
887 root := &cobra.Command{
888 Use: "dbxcli",
889 Short: "Scriptable Dropbox CLI for files, shared links, teams, and automation",
890 SilenceUsage: true,
891 SilenceErrors: true,
892 PersistentPreRunE: initDbx,
893 }
894 root.PersistentFlags().BoolP("verbose", "v", false, "Enable verbose logging")
895 root.PersistentFlags().String(outputFlag, "text", "Output format: text, json")
896 root.PersistentFlags().String("as-member", "", "Member ID to perform action as")
897 root.PersistentFlags().String("domain", "", "Override default Dropbox domain, useful for testing")
898 if err := root.PersistentFlags().MarkHidden("domain"); err != nil {
899 t.Fatalf("hide domain flag: %v", err)
900 }
901
902 ls := &cobra.Command{
903 Use: "ls [flags] [<path>]",
904 Short: "List files and folders",
905 RunE: func(cmd *cobra.Command, args []string) error { return nil },
906 }
907 enableStructuredOutput(ls)
908 ls.Flags().BoolP("include-deleted", "d", false, "Include deleted files")
909
910 login := &cobra.Command{
911 Use: "login",
912 Short: "Log in and save Dropbox credentials",
913 RunE: func(cmd *cobra.Command, args []string) error { return nil },
914 }
915
916 logout := &cobra.Command{
917 Use: "logout",
918 Short: "Log out of the current session",
919 RunE: func(cmd *cobra.Command, args []string) error { return nil },
920 }
921 enableStructuredOutput(logout)
922
923 rm := &cobra.Command{
924 Use: "rm [flags] <file>",
925 Short: "Remove files or folders",
926 RunE: func(cmd *cobra.Command, args []string) error { return nil },
927 }
928 enableStructuredOutput(rm)
929 setCommandDestructiveLevel(rm, destructiveLevelDelete)
930
931 team := &cobra.Command{
932 Use: "team",
933 Short: "Team management commands",
934 }
935 teamInfo := &cobra.Command{
936 Use: "info",
937 Short: "Get team information",
938 RunE: func(cmd *cobra.Command, args []string) error { return nil },
939 }
940 enableStructuredOutput(teamInfo)
941 teamAdd := &cobra.Command{

Calls 3

enableStructuredOutputFunction · 0.85
installJSONHelpFunction · 0.85

Tested by

no test coverage detected