コード例 #1
0
        public void Initialize(ExtensionInitializer cli)
        {
            Parser<IEnumerable<ICommandLineElement>, ISwitchElement> switches =
                (from create in cli.Switch("create") select create);

            cli.Add(from config in cli.Argument("init")
                    from create in switches.Optional("create", false)
                    from path in cli.ValidPath()
                    select cli.GetCommand<InitializeCommand>(new {path = path.Id, create = create.Value}));

            cli.Add(from path in cli.Argument("pathify")
                    select cli.GetCommand<AddToPathCommand>());
        }
コード例 #2
0
ファイル: AddCommandExtensions.cs プロジェクト: perikete/nu
        public void Initialize(ExtensionInitializer cli)
        {
            cli.Add(from add in cli.Argument("add")
                    from nam in cli.Argument()
                    from v in cli.Definition("version")
                    select cli.GetCommand<AddPackageCommand>(new {name = nam.Id, version = v.Value}));

            cli.Add(from add in cli.Argument("add")
                    from nam in cli.Argument()
                    select cli.GetCommand<AddPackageCommand>(new {name = nam.Id, version = AddPackageCommand.MAX}));

            cli.Add(from nuggify in cli.Argument("nuggify")
                    from n in cli.Definition("name")
                    from v in cli.Definition("version")
                    select cli.GetCommand<NuggifyCommand>(new {version = v.Value, name = n.Value}));
        }
コード例 #3
0
        public void Initialize(ExtensionInitializer cli)
        {
            Parser<IEnumerable<ICommandLineElement>, ISwitchElement> switches =
                (from verbose in cli.Switch("verbose") select verbose);

            cli.Add(from arg in cli.Argument("version")
                    from verbose in switches.Optional("verbose", false)
                    select cli.GetCommand<VersionCommand>(new {verbose = verbose.Value}));
        }
コード例 #4
0
 public void Initialize(ExtensionInitializer cli)
 {
     cli.Add(from project in cli.Argument("project")
             select cli.GetCommand<ProjectCommand>());
 }
コード例 #5
0
ファイル: ConfigCommandExtension.cs プロジェクト: wbinford/nu
        public void Initialize(ExtensionInitializer cli)
        {
            cli.Add(from config in cli.Argument("config")
                    from global in cli.Switch("global")
                    from get in cli.Switch("get")
                    from k in cli.Argument()
                    select cli.GetCommand<GetGlobalConfigurationCommand>(new {key = k.Id}));

            cli.Add(from config in cli.Argument("config")
                    from get in cli.Switch("get")
                    from k in cli.Argument()
                    select cli.GetCommand<GetConfigurationCommand>(new {key = k.Id}));

            cli.Add(from config in cli.Argument("config")
                    from global in cli.Switch("global")
                    from k in cli.Argument()
                    from v in cli.Argument()
                    select cli.GetCommand<SetGlobalConfigurationCommand>(new {key = k.Id, value = v.Id}));

            cli.Add(from config in cli.Argument("config")
                    from k in cli.Argument()
                    from v in cli.Argument()
                    select cli.GetCommand<SetProjectConfigurationCommand>(new {key = k.Id, value = v.Id}));

            cli.Add(from config in cli.Argument("config")
                    from list in cli.Switch("list")
                    select cli.GetCommand<ListProjectConfigurationCommand>());

            cli.Add(from config in cli.Argument("config")
                    from global in cli.Switch("global")
                    from list in cli.Switch("list")
                    select cli.GetCommand<ListGlobalConfigurationCommand>());

            cli.Add(from config in cli.Argument("config")
                        from rm in cli.Switch("rm")
                        from k in cli.Argument()
                        select cli.GetCommand<UnsetProjectConfigurationCommand>(new {key=k.Id}));

            cli.Add(from config in cli.Argument("config")
                    from global in cli.Switch("global")
                    from rm in cli.Switch("rm")
                    from k in cli.Argument()
                    select cli.GetCommand<UnsetGlobalConfigurationCommand>(new { key = k.Id }));
        }