Skip to content

dlatushkin/CommadLineUtil

Repository files navigation

File structure

There are 3 projects in the solution

CommadLineUtil

Represents entry point console .NET Core application. Program.cs contains code to configure command line parser and run commands/show help. Two commands and their agruments are configured

CommandLineUtil.Command

Represents .NET Core library for command implementation. There are 2 commands here:

prints out desired message ("hello world" if no message is explicitelly provided as argument)

defines CommandOne command srguments

lists the files/folders in the desired directory (current directory by default)

defines CommandTwo command srguments

FluentCommandLineParserCore

Original fluent-command-line-parser project ported to .NET Standard. The project is used to

  • parse command line arguments
  • fill command argument structures
  • execute commands
  • show help

How to compile

Windows

  • Install .NET Core 2.2 for Windows (The application has been tested on Windows 10).
  • Download the source code from the repository git clone https://github.com/dlatushkin/CommadLineUtil.git CommandLineUtil
  • Navigate to local repository directory
  • Run dotnet publish -o "../CommandLineUtilPublish"
  • Navigate to CommandLineUtilPublish folder
  • Try utility (see samples)

Linux

  • Install .NET Core 2.2 for appropriate linux distribution (The application has been tested on Ubuntu 18.0.4 LTS).
  • Download the source code from the repository sudo git clone https://github.com/dlatushkin/CommadLineUtil.git CommandLineUtil
  • Navigate to local repository directory
  • Run sudo dotnet publish -o "../CommandLineUtilPublish"
  • Navigate to CommandLineUtilPublish folder
  • Try utility (see samples)

Mac OS

  • Install .NET Core 2.2 for MacOS (The application has been tested on MacOS 10.14 Mojave).
  • Download the source code from the repository git clone https://github.com/dlatushkin/CommadLineUtil.git CommandLineUtil
  • Navigate to local repository directory
  • Run dotnet publish -o "../CommandLineUtilPublish"
  • Navigate to CommandLineUtilPublish folder
  • Try utility (see samples)

Usage samples

Show help

  • dotnet CommandLineUtil.dll -?
  • dotnet CommandLineUtil.dll --help

Run commandone with default message

  • dotnet CommandLineUtil.dll commandone

Run commandone with message parameter

  • dotnet CommandLineUtil.dll commandone --message "TEZTMSG"
  • dotnet CommandLineUtil.dll commandone -m "TEZTMSG"

Run commandtwo with default parameters

  • `dotnet CommandLineUtil.dll commandtwo

Run commandtwo with parameters specified

  • dotnet CommandLineUtil.dll commandtwo --path ".." --include-dir
  • dotnet CommandLineUtil.dll commandtwo -p ".." -d

About

.NET Core 2.2 command line utility

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages