From 9551d470c71a23bdbb7aba8f0fa99fe525bcfef1 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Fri, 4 Apr 2025 01:23:02 +0300 Subject: [PATCH] Reorganize documentation --- doc/CLI arguments processing.html | 358 ------------------------------ doc/CLI arguments processing.org | 69 ------ doc/index.org | 71 +++++- 3 files changed, 68 insertions(+), 430 deletions(-) delete mode 100644 doc/CLI arguments processing.html delete mode 100644 doc/CLI arguments processing.org diff --git a/doc/CLI arguments processing.html b/doc/CLI arguments processing.html deleted file mode 100644 index 30814c6..0000000 --- a/doc/CLI arguments processing.html +++ /dev/null @@ -1,358 +0,0 @@ - - - - - - - -Commandline interface arguments processing - - - - - - -
-

Commandline interface arguments processing

- - - -
-

1. Terminology

-
-
-
-

1.1. Command and argument

-
-

-Every command-line application has a way of receiving input from -users, usually in the form of command-line arguments. A command-line -argument is a piece of information provided to the command-line -application when it's invoked. These arguments are provided as an -array of strings. The first element of the array (argument 0) is -typically the name of the command itself. -

- -

-In the example below, 'my-video-coder' is our command, and the rest -are arguments: -

- -
-
my-video-coder encode --input vid1.mp4 vid2.mp4 vid3.mp4 --quality 5
-
-
- -

-To better understand how these concepts work together, let's break -down our example command: -

- - - - --- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
argument #value(s)type
0my-video-codercommand
1encodesubcommand
2–inputoption1
3, 4, 5vid1.mp4 vid2.mp4 vid3.mp4parameters for –input option
6–qualityoption2
75parameter for –quaily option
-
-
- -
-

1.2. Subcommand

-
-

-Subcommands are arguments that invoke more specific action that a -command can perform. They are often used with commands that have -multiple functions. In our example, encode is a subcommand of -my-video-coder. -

-
-
- -
-

1.3. Option

-
-

-Options are arguments that change the behavior of a command or -subcommand. They usually start with a dash (-) or double dash -(–). For instance, –input and –quality are options in our -example command. -

-
-
- -
-

1.4. Parameter

-
-

-Parameter provides additional information to a command, subcommand or -option. -

- -

-For instance, in our example: -

-
    -
  • 'vid1.mp4 vid2.mp4 vid3.mp4' are parameters for the –input option.
  • -
  • '5' is a parameter for the –quality option.
  • -
-
-
-
-
-
-

Author: Svjatoslav Agejenko

-

Created: 2023-10-12 Thu 23:05

-

Validate

-
- - diff --git a/doc/CLI arguments processing.org b/doc/CLI arguments processing.org deleted file mode 100644 index c385fcb..0000000 --- a/doc/CLI arguments processing.org +++ /dev/null @@ -1,69 +0,0 @@ -:PROPERTIES: -:ID: 46115263-ed3d-4acc-9ec5-523d7acf87b8 -:END: -#+TITLE: Commandline interface arguments processing -#+AUTHOR: Svjatoslav Agejenko -#+LANGUAGE: en - -- [[id:bb4f96cd-458c-495b-a605-313b2e3e28d2][Back to CLI Helper - library main page]] - -* Terminology -** Command and argument - -Every command-line application has a way of receiving input from -users, usually in the form of command-line arguments. A command-line -argument is a piece of information provided to the command-line -application when it's invoked. These arguments are provided as an -array of strings. The first element of the array (argument 0) is -typically the name of the command itself. - -In the example below, 'my-video-coder' is our command, and the rest -are arguments: - -#+BEGIN_SRC shell -my-video-coder encode --input vid1.mp4 vid2.mp4 vid3.mp4 --quality 5 -#+END_SRC - -To better understand how these concepts work together, let's break -down our example command: - -| argument # | value(s) | type | -|------------+----------------------------+-------------------------------| -| 0 | my-video-coder | command | -| 1 | encode | [[id:94242e8a-c59b-42fd-8cc7-ba3df1938119][subcommand]] | -| 2 | --input | [[id:ffedf388-4d23-41eb-98d0-83fd3940b24d][option1]] | -| 3, 4, 5 | vid1.mp4 vid2.mp4 vid3.mp4 | [[id:8a39d20c-421f-4bc7-94e4-8e561e58bea0][parameters for --input option]] | -| 6 | --quality | [[id:ffedf388-4d23-41eb-98d0-83fd3940b24d][option2]] | -| 7 | 5 | [[id:8a39d20c-421f-4bc7-94e4-8e561e58bea0][parameter for --quaily option]] | - -** Subcommand -:PROPERTIES: -:ID: 94242e8a-c59b-42fd-8cc7-ba3df1938119 -:END: - -Subcommands are arguments that invoke more specific action that a -command can perform. They are often used with commands that have -multiple functions. In our example, *encode* is a subcommand of -*my-video-coder*. - -** Option -:PROPERTIES: -:ID: ffedf388-4d23-41eb-98d0-83fd3940b24d -:END: - -Options are arguments that change the behavior of a command or -subcommand. They usually start with a dash (-) or double dash -(--). For instance, *--input* and *--quality* are options in our -example command. - -** Parameter -:PROPERTIES: -:ID: 8a39d20c-421f-4bc7-94e4-8e561e58bea0 -:END: - -Parameter provides additional information to a command, subcommand or -option. - -For instance, in our example: -- 'vid1.mp4 vid2.mp4 vid3.mp4' are parameters for the *--input* option. -- '5' is a parameter for the *--quality* option. diff --git a/doc/index.org b/doc/index.org index 2abb164..85cda1a 100644 --- a/doc/index.org +++ b/doc/index.org @@ -24,11 +24,10 @@ dependency to your project. Library provides following general functionalities: - [[id:4fca35e4-fdf1-4675-a36f-6206d6fb72cb][Asking for user input]] -- [[id:46115263-ed3d-4acc-9ec5-523d7acf87b8][Commandline arguments processing]] +- [[id:eb7d5632-6152-4d37-8e55-1cf4da21c204][Commandline arguments processing]] -See also: [[https://clig.dev/][Command Line Interface Guidelines]]. -** Ask for user input +* User input helper :PROPERTIES: :ID: 4fca35e4-fdf1-4675-a36f-6206d6fb72cb :END: @@ -59,6 +58,72 @@ public class Demo { See [[https://www3.svjatoslav.eu/projects/cli-helper/apidocs/eu/svjatoslav/commons/cli_helper/CLIHelper.html][Javadoc]] for complete API reference. +* CLI argument helper +:PROPERTIES: +:ID: eb7d5632-6152-4d37-8e55-1cf4da21c204 +:END: + +See also: [[https://clig.dev/][Command Line Interface Guidelines]]. + +** Command and argument + +Every command-line application has a way of receiving input from +users, usually in the form of command-line arguments. A command-line +argument is a piece of information provided to the command-line +application when it's invoked. These arguments are provided as an +array of strings. The first element of the array (argument 0) is +typically the name of the command itself. + +In the example below, 'my-video-coder' is our command, and the rest +are arguments: + +#+BEGIN_SRC shell +my-video-coder encode --input vid1.mp4 vid2.mp4 vid3.mp4 --quality 5 +#+END_SRC + +To better understand how these concepts work together, let's break +down our example command: + +| argument # | value(s) | type | +|------------+----------------------------+-------------------------------| +| 0 | my-video-coder | command | +| 1 | encode | [[id:94242e8a-c59b-42fd-8cc7-ba3df1938119][subcommand]] | +| 2 | --input | [[id:ffedf388-4d23-41eb-98d0-83fd3940b24d][option1]] | +| 3, 4, 5 | vid1.mp4 vid2.mp4 vid3.mp4 | [[id:8a39d20c-421f-4bc7-94e4-8e561e58bea0][parameters for --input option]] | +| 6 | --quality | [[id:ffedf388-4d23-41eb-98d0-83fd3940b24d][option2]] | +| 7 | 5 | [[id:8a39d20c-421f-4bc7-94e4-8e561e58bea0][parameter for --quaily option]] | + +** Subcommand +:PROPERTIES: +:ID: 94242e8a-c59b-42fd-8cc7-ba3df1938119 +:END: + +Subcommands are arguments that invoke more specific action that a +command can perform. They are often used with commands that have +multiple functions. In our example, *encode* is a subcommand of +*my-video-coder*. + +** Option +:PROPERTIES: +:ID: ffedf388-4d23-41eb-98d0-83fd3940b24d +:END: + +Options are arguments that change the behavior of a command or +subcommand. They usually start with a dash (-) or double dash +(--). For instance, *--input* and *--quality* are options in our +example command. + +** Parameter +:PROPERTIES: +:ID: 8a39d20c-421f-4bc7-94e4-8e561e58bea0 +:END: + +Parameter provides additional information to a command, subcommand or +option. + +For instance, in our example: +- 'vid1.mp4 vid2.mp4 vid3.mp4' are parameters for the *--input* option. +- '5' is a parameter for the *--quality* option. * Getting the library Follow instructions to embed *cli-helper* library in your project. -- 2.20.1