ArgShortcut

Namespace: PowerArgs
We found 10 examples in language CSharp for this search. You will see 15 fragments of code.
using PowerArgs;

namespace OmegaGraf.Compose
{
    public class MyArgs
    {
        [ArgShortcut("-h"), ArgShortcut("--help"), ArgDescription("Shows this help and exits.")]
        public bool Help { get; set; }

        [ArgShortcut("--version"), ArgDescription("Prints version info and exits.")]
        public bool Version { get; set; }

        [ArgShortcut("-v"), ArgShortcut("--verbose"), ArgDescription("Enables verbose logging.")]
        public bool Verbose { get; set; }

        [ArgShortcut("-p"), ArgShortcut("--path"), ArgDescription("Sets path to container data. Defaults to working directory."), ArgDefaultValue("")]
        public string Path { get; set; }

        [ArgShortcut("--host"), ArgDescription("Sets the listen addresses for this application."), ArgDefaultValue("http://0.0.0.0:5000")]
        public string[] Host { get; set; }

        [ArgShortcut("-s"), ArgShortcut("--sock"), ArgDescription("Overrides the Docker socket path.")]
        public string Socket { get; set; }

        [ArgShortcut("-k"), ArgShortcut("--key"), ArgDescription("Overrides the OmegaGraf Secure Key.")]
        public string Key { get; set; }

        [ArgShortcut("-r"), ArgShortcut("--reset"), ArgDescription("Removes existing OmegaGraf containers.")]
        public bool Reset { get; set; }

        [ArgShortcut("-o"), ArgShortcut("--overwrite"), ArgDescription("Overwrites existing OmegaGraf containers when a new request is received.")]
        public bool Overwrite { get; set; }

        [ArgShortcut("-d"), ArgShortcut("--dev"), ArgDescription("Enables development mode.")]
        public bool Dev { get; set; }
    }
}

using PowerArgs;

namespace Microsoft.CodePlex.Migration.WorkItems
{
    [ArgExceptionBehavior(ArgExceptionPolicy.StandardExceptionHandling)]
    internal class ProgramArguments
    {
        [HelpHook, ArgShortcut("-?"), ArgDescription("Shows this help")]
        public bool Help { get; set; }

        [ArgRequired, ArgShortcut("-p"), ArgDescription("The name of the CodePlex project to migrate")]
        public string CodePlexProject { get; set; }

        [ArgRequired, ArgShortcut("-o"), ArgDescription("The owner of the GitHub repository to which issues are migrated")]
        public string GitHubRepoOwner { get; set; }

        [ArgRequired, ArgShortcut("-r"), ArgDescription("The name of the GitHub repository to which issues are migrated")]
        public string GitHubRepo { get; set; }

        [ArgRequired, ArgShortcut("-t"), ArgDescription("Personal Access Token to be used for accessing the GitHub repository")]
        public string GitHubPersonalAccessToken { get; set; }

        [ArgShortcut("-m"), ArgDescription("The maximum number of items to migrate. If -1 all items will be migrated"), DefaultValue(-1), ArgRange(-1, int.MaxValue)]
        public int MaxItemsToMigrate { get; set; }

        [ArgShortcut("-l"), ArgDescription("Path and name of the log file"), DefaultValue("migration.log")]
        public string LogFilePath { get; set; }

        [ArgShortcut("-c"), ArgDescription("Flag to tell migrator if the closed work items should be migrated"), DefaultValue(true)]
        public bool MigrateClosedItems { get; set; }

        [ArgShortcut("-s"), ArgDescription("Comma-separated list of work item IDs to exclude from migration")]
        public int[] WorkItemsToSkip { get; set; }

        [ArgShortcut("-WhatIf"), ArgDescription("Flag to tell migrator to only read work items and print results to console"), DefaultValue(false)]
        public bool OnlyWriteMigrationToConsole { get; set; }
    }
}

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PowerArgs;

namespace NuHost
{
    public class Arguments
    {
        [ArgShortcut("-?")]
        [ArgShortcut("-h")]
        [ArgDescription("Shows help for the command")]
        public bool Help { get; set; }

        [ArgShortcut("-b")]
        [ArgDescription("(OPTIONAL) The base directory in which to locate services. Leave blank to use the current directory")]
        public string BaseDirectory { get; set; }

        [ArgPosition(0)]
        [ArgShortcut("-s")]
        [ArgDescription("(OPTIONAL) The services to execute. Leave blank to run all services.")]
        public string[] Services { get; set; }

        [ArgShortcut("-p")]
        [ArgDescription("(OPTIONAL) The HTTP Port to use. Leave blank to disable HTTP")]
        public int? HttpPort { get; set; }

        [ArgShortcut("-ps")]
        [ArgDescription("(OPTIONAL) The HTTPS Port to use. Leave blank to disable HTTPS")]
        public int? HttpsPort { get; set; }

        [ArgShortcut("-u")]
        [ArgDescription("(OPTIONAL) The URLs to bind HTTP services to.")]
        public string[] Urls { get; set; }

        [ArgShortcut("-path")]
        [ArgDescription("(OPTIONAL) The root path to use for the service.")]
        public string HttpPath { get; set; }

        [ArgShortcut("-c")]
        [ArgDescription("JSON key/value pairs containing configuration data")]
        public string Configuration { get; set; }
    }
}

using PowerArgs;

namespace Chameleon
{
    public class CmdArgs
    {
        [HelpHook, ArgShortcut("-?"), ArgDescription("Shows this help")]
        public bool Help { get; set; }

        [ArgShortcut("-input"), ArgDescription("Location of the .lyr file to be processed.")]
        [ArgRequired(PromptIfMissing = true)]
        [ArgExistingFile]
        [ArgRegex(@".*\.lyr", "Input file must be a .lyr file")]
        public string InputFile { get; set; }

        [ArgShortcut("-output"), ArgDescription("Location of the file system folder to save the processed file to.")]
        [ArgRequired(PromptIfMissing = true)]
        public string OutputFolder { get; set; }

        [ArgShortcut("-hex"), ArgDescription("Hex colour value to set the input .lyr file symbol to. Can omit the # if you want.")]
        [ArgRequired(PromptIfMissing = true)]
        public string Colour { get; set; }

        [ArgShortcut("-useInput"), ArgDescription("If true then the app will try to get the symbol type from the inpit filename. The file should only contain the symbol type e.g. point.lyr")]
        [ArgDefaultValue(true)]
        public bool GetSymbolTypeFromInputFileName { get; set; }

        [ArgShortcut("-saveUnique"), ArgDescription("If true then the app will get a unique filename for the output file and not overwrite any existing files.")]
        public bool SaveFileNameUnique { get; set; }

        [ArgShortcut("-wait"), ArgDescription("If true then the app will not exit until the user presses the 'Esc' key.")]
        public bool WaitToExit { get; set; }

        [ArgShortcut("-symbol"), ArgDescription("Symbol (geometry) type to set for the output layer. Default is point.")]
        [ArgDefaultValue("point")]
        public string SymbolType { get; set; }

        [ArgShortcut("-size"), ArgDescription("Size of the point symbol to use if symbol type is set as point. Default is 10.")]
        [ArgDefaultValue(10.0)]
        public double PointSize { get; set; }

        [ArgShortcut("-width"), ArgDescription("With of the polyline symbol to use if symbol type is set as polyline. or the width of the polygon outline if symbol type is set to polygon. Default is 1.")]
        [ArgDefaultValue(1.0)]
        public double LineWidth { get; set; }

        [ArgShortcut("-hexOutline"), ArgDescription("Hex colour value to set the polygon symbol outline to. If not set then the outline will be the same colour as the fill. Can omit the # if you want.")]
        public string OutlineColour { get; set; }
    }
}

using System;
using PowerArgs;

namespace Trek.Monitoring.Prtg.Azure.BlobMonitor
{
    public class MonitorArgs
    {
        [ArgShortcut("N"),
            ArgRequired,
            ArgDescription("Required: The name of the storage account")]
        public string StorageAccountName { get; set; }

        [ArgShortcut("K"), 
            ArgRequired,
            ArgDescription("Required: The storage account's key")]
        public string StorageAccountKey { get; set; }

        [ArgShortcut("C"), 
            ArgDescription("Optional: The name of the container to look in.  If not provided will look into the most recently modified container")]
        public string ContainerName { get; set; }

        [ArgShortcut("B"), 
            ArgDefaultValue(".*"),
            ArgDescription("Optional: A RegEx to describe the pattern of name of the blobs to look for"),
            ArgExample("^log-.*", "All blobs starting with log-")]
        public string BlobNamePattern { get; set; }

        [ArgShortcut("S"),
            ArgDefaultValueAttribute(true),
            ArgDescription("Optional: Should the results include blobs found in virtual directories under the container")]
        public bool MatchInSubdirectories { get; set; }

        [ArgShortcut("MA"),
            ArgDescription("Optional: A TimeSpan string descibing how long ago to look back")]
        public TimeSpan ModifiedAfter { get; set; } = TimeSpan.Zero;

        [ArgShortcut("MB"), 
            ArgDescription("Optional: A TimeSpan string descibing how long ago to stop looking")]
        public TimeSpan ModifiedBefore { get; set; } = TimeSpan.Zero;

    }
}

//------------------------------------------------------------------------------
// <copyright company="LeanKit Inc.">
//     Copyright (c) LeanKit Inc.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using PowerArgs;

namespace LeanKitCmdQuery
{
	[ArgExample("LeanKitCmdQuery -h [account name] -u [email] -p [password] [-b [board id]]", "Query LeanKit and output results to console.")]
	public class QueryArgs
	{
		[ArgRequired(PromptIfMissing = false, Priority = 9)]
		[ArgShortcut("h")]
		[ArgDescription("LeanKit host name (e.g. CompanyName)")]
		public string Host { get; set; }

		[ArgRequired(PromptIfMissing = false, Priority = 8)]
		[ArgShortcut("u")]
		[ArgDescription("Account email address")]
		public string User { get; set; }

		[ArgRequired(PromptIfMissing = false, Priority = 7)]
		[ArgShortcut("p")]
		[ArgDescription("Account password")]
		public string Password { get; set; }

		[ArgShortcut("b")]
		[ArgDescription("Specify a board with the given identifier (ID)")]
		public long Board { get; set; }

		[ArgDescription("List all boards available to account")]
		public bool Boards { get; set; }

		[ArgDescription("List all lanes for the given board")]
		public bool Lanes { get; set; }

		[ArgShortcut("l")]
		[ArgDescription("Specify a lane with the given identifier (ID)")]
		public long Lane { get; set; }

		[ArgShortcut("backlog")]
		[ArgDescription("Include backlog lane(s)")]
		public bool IncludeBacklog { get; set; }

		[ArgShortcut("archive")]
		[ArgDescription("Include archive lane(s)")]
		public bool IncludeArchive { get; set; }

		[ArgDescription("List all cards for the given board or lane")]
		public bool Cards { get; set; }

		[ArgDescription("Output results in comma-delimited format (CSV)")]
		public bool Csv { get; set; }

		[ArgDescription("Output results in JSON format")]
		public bool Json { get; set; }
	}
}

using PowerArgs;

namespace ISCIII.AESEG.ClienteJustificacion.BLL
{
    public class ClientArgs
    {
        [ArgRequired()]
        [ArgShortcut("u")]
        [ArgDescription("Nombre de usuario.")]
        public string User { get; set; }

        [ArgRequired()]
        [ArgShortcut("p")]
        [ArgDescription("Contraseña.")]
        public string Password { get; set; }

        [ArgRequired()]
        [ArgShortcut("t")]
        [ArgDescription("Tipo de justificantes.")]
        public JustificacionFileType FileType { get; set; }

        [ArgRequired()]
        [ArgShortcut("f")]
        [ArgExistingFile]
        [ArgDescription("Ruta del fichero csv.")]
        public string File { get; set; }

        [ArgShortcut("c")]
        [ArgExistingFile]
        [ArgDescription("Codificación de fichero.")]
        public Codificacion Encoding { get; set; }
    }

    public enum JustificacionFileType
    {
        Bienes,
        Viajes,
        Personal
    }

    public enum Codificacion
    {
        UTF8,
        Windows1252
    }
}


    private void PubTwist(double linear, double angular)
    {
        // type to write: geometry_msgs/msg/Twist
        CDRWriter cdrWriter = new CDRWriter();
        // Vector3 linear => float64 x + float64 y + float64 z
        cdrWriter.WriteDouble(linear * _linearScale);
        cdrWriter.WriteDouble(0.0);
        cdrWriter.WriteDouble(0.0);
        // Vector3 angular => float64 x + float64 y + float64 z
        cdrWriter.WriteDouble(0.0);
        cdrWriter.WriteDouble(0.0);
        cdrWriter.WriteDouble(angular * _angularScale);
        _session.Write(_cmdKey, cdrWriter.GetBuffer().ToArray());
    }

    private void OutCallback(Zenoh.Net.Sample sample)
    {
        // received type: rcl_interfaces/msg/Log
        CDRReader reader = new CDRReader(sample.Payload);
        // builtin_interfaces/Time stamp => int32 sec + uint32 nanosec
        var stamp_sec = reader.ReadInt32();
        var stamp_nanosec = reader.ReadUInt32();
        // uint8 level
        var level = reader.ReadByte();
        // string name
        var name = reader.ReadString();
        // string msg
        var msg = reader.ReadString();
        // string file
        var file = reader.ReadString();
        // string function
        var function = reader.ReadString();
        // uint32 line
        var line = reader.ReadUInt32();

        Console.WriteLine("[{0}.{1}] [{2}]: {3}", stamp_sec, stamp_nanosec, name, msg);
    }

    private void run()
    {
        Console.WriteLine("Waiting commands with arrow keys or space bar to stop. Press ESC to quit.");
        ConsoleKeyInfo cki;
        do
        {
            cki = Console.ReadKey();
            switch (cki.Key)
            {
                case ConsoleKey.UpArrow:
                    {
                        PubTwist(1.0, 0.0);
                        break;
                    }
                case ConsoleKey.DownArrow:
                    {
                        PubTwist(-1.0, 0.0);
                        break;
                    }
                case ConsoleKey.LeftArrow:
                    {
                        PubTwist(0.0, 1.0);
                        break;
                    }
                case ConsoleKey.RightArrow:
                    {
                        PubTwist(0.0, -1.0);
                        break;
                    }
                case ConsoleKey.Spacebar:
                    {
                        PubTwist(0.0, 0.0);
                        break;
                    }
                default: break;
            }
        } while (cki.Key != ConsoleKey.Escape);
        // Stop robot at exit
        PubTwist(0.0, 0.0);
    }


    static void Main(string[] args)
    {
        try
        {
            // arguments parsing
            var arguments = Args.Parse<ExampleArgs>(args);
            if (arguments == null) return;
            Dictionary<string, string> conf = arguments.GetConf();

            var teleop = new Teleop(conf, arguments.cmdTopic, arguments.outTopic, arguments.linearScale, arguments.angularScale);
            teleop.run();
        }
        catch (ArgException)
        {
            Console.WriteLine(ArgUsage.GenerateUsageFromTemplate<ExampleArgs>());
        }
    }

    public Dictionary<string, string> GetConf()
    {
        var conf = new Dictionary<string, string>();
        conf.Add("mode", this.mode);
        if (this.peer != null)
        {
            conf.Add("peer", this.peer);
        }
        if (this.listener != null)
        {
            conf.Add("listener", this.listener);
        }
        if (this.config != null)
        {
            conf.Add("config", this.config);
        }
        return conf;
    }


        public static ScriptCsArgs Parse(string[] args)
        {
            Guard.AgainstNullArgument("args", args);

            var curatedArgs = new List<string>();
            string implicitPackageVersion = null;
            for (var index = 0; index < args.Length; ++index)
            {
                if (index < args.Length - 2 &&
                    (string.Equals(args[index], "-install", StringComparison.OrdinalIgnoreCase) ||
                        string.Equals(args[index], "-i", StringComparison.OrdinalIgnoreCase)) &&
                    !args[index + 1].StartsWith("-", StringComparison.Ordinal) &&
                    !args[index + 2].StartsWith("-", StringComparison.Ordinal))
                {
                    curatedArgs.Add(args[index]);
                    curatedArgs.Add(args[index + 1]);
                    implicitPackageVersion = args[index + 2];
                    index += 2;
                }
                else
                {
                    curatedArgs.Add(args[index]);
                }
            }

            var scriptCsArgs = Args.Parse<ScriptCsArgs>(curatedArgs.ToArray());
            scriptCsArgs.PackageVersion = scriptCsArgs.PackageVersion ?? implicitPackageVersion;
            return scriptCsArgs;
        }

        public static string GetUsage()
        {
            return ArgUsage.GetUsage<ScriptCsArgs>(
                null, new ArgUsageOptions { ShowPosition = false, ShowType = false, });
        }

using PowerArgs;

namespace SolutionFactory
{
    public class FactoryArgs
    {
        [ArgShortcut("p")]
        [ArgDescription("Path to Solution FolderRoot")]
        [ArgExistingDirectory]
        [ArgPosition(0)]
        [ArgRequired(PromptIfMissing = false)]
        [ArgExample(@"""c:\path\to\solution""", "Full path to the root of the solution")]
        public string PathToSolution { get; set; }

        [ArgShortcut("n")]
        [ArgDescription("Namespace of new solution")]
        [ArgPosition(1)]
        [ArgRequired(PromptIfMissing = false)]
        public string Namespace { get; set; }

        [ArgShortcut("f")]
        [ArgDescription("Friendly name of solution, with no dot's or spaces.")]
        [ArgPosition(2)]
        [ArgRequired(PromptIfMissing = false)]
        [ArgRegex("^[a-zA-Z0-9_]+$", "Only letters, and underscore!")]
        public string FriendlyName { get; set; }


        [ArgShortcut("c")]
        [ArgPosition(3)]
        public bool CleanOnly { get; set; }
    }
}

PowerArgs.ArgShortcut : IArgumentOrActionMetadata, ICommandLineActionMetadata, IArgMetadata, ICommandLineArgumentMetadata

Constructors :

public ArgShortcut(String shortcut = )
public ArgShortcut(ArgShortcutPolicy policy = )

Methods :

public String get_Shortcut()
public ArgShortcutPolicy get_Policy()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()
public Object get_TypeId()
public Boolean Match(Object obj = )
public Boolean IsDefaultAttribute()
public Type GetType()
public String ToString()

Other methods