Skip to content

Commit 7ed68e5

Browse files
committed
GNATcheck: add the -V short format option for --version
To mimic lkql tools version options.
1 parent 9d9874c commit 7ed68e5

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

lkql_checker/doc/gnatcheck_rm/using_gnatcheck.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The following switches control the general ``gnatcheck`` behavior
1616
.. index:: --version
1717

1818

19-
``--version``
19+
``-V, --version``
2020
Display Copyright and version, then exit disregarding all other options.
2121

2222
.. index:: --help
@@ -395,7 +395,7 @@ GNATcheck:
395395
There are several command-line switches that you cannot pass through the
396396
``Switches`` attribute:
397397

398-
* ``--version``
398+
* ``-V, --version``
399399
* ``-h, --help``
400400
* ``--list-rules``
401401
* ``-P``

lkql_checker/src/gnatcheck-options.ads

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ package Gnatcheck.Options is
218218
(Parser => Parser,
219219
Name => "Version",
220220
Long => "--version",
221+
Short => "-V",
221222
Help => "show the tool version and exit");
222223

223224
package Help is new

lkql_checker/src/gnatcheck-output.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ package body Gnatcheck.Output is
437437
Put_Line
438438
("usage: gnatkp -Pproject [options] [-rules [-from=file] {+Rkp_id[:param]}]");
439439
Put_Line ("options:");
440-
Put_Line (" --version - Display version and exit");
440+
Put_Line (" -V, --version - Display version and exit");
441441
Put_Line (" -h, --help - Display usage and exit");
442442
Put_Line ("");
443443
Put_Line
@@ -504,7 +504,7 @@ package body Gnatcheck.Output is
504504
Put_Line
505505
("usage: gnatcheck [options] {filename} {-files=filename} -rules rule_switches [-cargs gcc_switches]");
506506
Put_Line ("options:");
507-
Put_Line (" --version - Display version and exit");
507+
Put_Line (" -V, --version - Display version and exit");
508508
Put_Line (" -h, --help - Display usage and exit");
509509
Put_Line ("");
510510
Put_Line
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Long format
2+
===========
3+
4+
gnatcheck <version> (<date>)
5+
Copyright (C) <date>, AdaCore.
6+
7+
Short format
8+
============
9+
10+
gnatcheck <version> (<date>)
11+
Copyright (C) <date>, AdaCore.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
driver: gnatcheck
2+
format: brief
3+
tests:
4+
- label: Long format
5+
extra_args:
6+
- '--version'
7+
- label: Short format
8+
extra_args:
9+
- '-V'

0 commit comments

Comments
 (0)