コード例 #1
0
 public override void Configure(CommandLineApplication command)
 {
     _app = command;
     command.Description      = "Search for files and folders in your Enterprise.";
     command.ExtendedHelpText = "You can use this command to search for files and folders.";
     _query               = command.Argument("query", "The search term");
     _asUser              = AsUserOption.ConfigureOption(command);
     _scope               = command.Option("--scope", "The scope on which you want search", CommandOptionType.SingleValue);
     _type                = command.Option("--type", "The type of objects you want to include in the search results", CommandOptionType.SingleValue);
     _fileExtenstions     = command.Option("--file-extensions", "Limit searches to specific file extensions", CommandOptionType.SingleValue);
     _mdFilterScope       = command.Option("--md-filter-scope", "Scope for metadata filter, can use multiple times", CommandOptionType.MultipleValue);
     _mdFilterTemplateKey = command.Option("--md-filter-template-key", "Template key for metadata filter, can use multiple times", CommandOptionType.MultipleValue);
     _mdFilterJson        = command.Option("--md-filter-json", "JSON string of metadata to filter search, can use multiple times", CommandOptionType.MultipleValue);
     _contentTypes        = command.Option("--content-types",
                                           "Search for objects of specified content types. Requires a content type or a set of comma-delimited content types",
                                           CommandOptionType.SingleValue);
     _ancestorFolderIds = command.Option("--ancestor-folder-ids",
                                         "Search for objects by owner. Requires a user ID or a set of comma-delimited user IDs",
                                         CommandOptionType.SingleValue);
     _ownerUserIds = command.Option("--owner-user-ids",
                                    "Search for the contents of specific folders (and folders within them). Requires a folder ID or a set of comma-delimited folder IDs",
                                    CommandOptionType.SingleValue);
     _createdAtFrom = command.Option("--created-at-from",
                                     "The date when the item was created, used with --created-at-to. Use a RFC3339 timestamp or shorthand syntax 00t, like 05w for 5 weeks",
                                     CommandOptionType.SingleValue);
     _createdAtTo = command.Option("--created-at-to",
                                   "The date when the item was created, used with --created-at-from. Use a RFC3339 timestamp or shorthand syntax 00t, like 05w for 5 weeks",
                                   CommandOptionType.SingleValue);
     _updatedAtFrom = command.Option("--updated-at-from",
                                     "The date when the item was updated, used with --updated-at-to. Use a RFC3339 timestamp or shorthand syntax 00t, like 05w for 5 weeks",
                                     CommandOptionType.SingleValue);
     _updatedAtTo = command.Option("--updated-at-to",
                                   "The date when the item was updated, used with --updated-at-from. Use a RFC3339 timestamp or shorthand syntax 00t, like 05w for 5 weeks",
                                   CommandOptionType.SingleValue);
     command.OnExecute(async() =>
     {
         return(await this.Execute());
     });
     base.Configure(command);
 }
コード例 #2
0
 public override void Configure(CommandLineApplication command)
 {
     _asUser = AsUserOption.ConfigureOption(command);
     base.Configure(command);
 }