Skip to content

Commit fe2cbb1

Browse files
committed
[more] fixed problems
1 parent c502809 commit fe2cbb1

File tree

4 files changed

+53
-16
lines changed

4 files changed

+53
-16
lines changed

.github/workflows/TestingCI.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Rust
22

33
on:
44
push:
5-
branches:
6-
- more
75
pull_request:
86

97
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11

22
target/
3+

display/more.rs

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99

1010
use clap::Parser;
11-
use gettextrs::{bind_textdomain_codeset, setlocale, textdomain, LocaleCategory};
11+
use gettextrs::{bind_textdomain_codeset, gettext, setlocale, textdomain, LocaleCategory};
1212
use libc::{
1313
getegid, getgid, getuid, regcomp, regex_t, regexec, setgid, setuid, REG_ICASE, REG_NOMATCH,
1414
};
@@ -42,53 +42,83 @@ static NEED_QUIT: Mutex<bool> = Mutex::new(false);
4242
#[derive(Parser)]
4343
#[command(version, about = "more - display files on a page-by-page basis")]
4444
struct Args {
45-
// Enable interactive session test
46-
#[arg(long = "test", help = "Enable interactive session test.")]
47-
test: bool,
48-
4945
/// Do not scroll, display text and clean line ends
50-
#[arg(short = 'c', help = "Do not scroll, display text and clean line ends.")]
46+
#[arg(
47+
short = 'c',
48+
long = "print-over",
49+
help = gettext("Do not scroll, display text and clean line ends")
50+
)]
5151
print_over: bool,
5252

5353
/// Exit on end-of-file
54-
#[arg(short = 'e', help = "Exit on end-of-file.")]
54+
#[arg(
55+
short = 'e',
56+
long = "exit-on-eof",
57+
help = gettext("Exit on end-of-file")
58+
)]
5559
exit_on_eof: bool,
5660

5761
/// Perform pattern matching in searches without regard to case
5862
#[arg(
5963
short = 'i',
60-
help = "Perform pattern matching in searches without regard to case."
64+
long = "ignore-case",
65+
help = gettext("Perform pattern matching in searches without regard to case")
6166
)]
6267
case_insensitive: bool,
6368

6469
/// Execute the more command(s) in the command arguments in the order specified
6570
#[arg(
6671
short = 'p',
67-
help = "Execute the more command(s) in the command arguments in the order specified."
72+
long = "execute",
73+
help = gettext("Execute the more command(s) in the command arguments in the order specified")
6874
)]
6975
commands: Option<String>,
7076

7177
/// Squeeze multiple blank lines into one
72-
#[arg(short = 's', help = "Squeeze multiple blank lines into one.")]
78+
#[arg(
79+
short = 's',
80+
long = "squeeze",
81+
help = gettext("Squeeze multiple blank lines into one")
82+
)]
7383
squeeze: bool,
7484

7585
/// Write the screenful of the file containing the tag named by the tagstring argument
7686
#[arg(
7787
short = 't',
78-
help = "Write the screenful of the file containing the tag named by the tagstring argument."
88+
long = "tag",
89+
help = gettext("Write the screenful of the file containing the tag named by the tagstring argument")
7990
)]
8091
tag: Option<String>,
8192

8293
/// Suppress underlining and bold
83-
#[arg(short = 'u', help = "Suppress underlining and bold.")]
94+
#[arg(
95+
short = 'u',
96+
long = "plain",
97+
help = gettext("Suppress underlining and bold")
98+
)]
8499
plain: bool,
85100

86101
/// The number of lines per screenful
87-
#[arg(short = 'n', help = "The number of lines per screenful.")]
102+
#[arg(
103+
short = 'n',
104+
long = "lines",
105+
help = gettext("The number of lines per screenful")
106+
)]
88107
lines: Option<u16>,
89108

109+
/// Enable interactive session test
110+
#[arg(
111+
short = 'd',
112+
long = "test",
113+
help = gettext("Enable interactive session test")
114+
)]
115+
test: bool,
116+
90117
/// A pathnames of an input files
91-
#[arg(name = "FILE", help = "A pathnames of an input files.")]
118+
#[arg(
119+
name = "FILES",
120+
help = gettext("A pathnames of input files")
121+
)]
92122
input_files: Vec<String>,
93123
}
94124

display/tags

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// This file used for testing `go to tag` command of more utility.
2+
// `go to tag` command has attribute `tagstring` that contains name
3+
// or pattern of searched code object. This tags file contains
4+
// file and line where are located `tagstring` object `SeekPositions`
5+
// that used in tests. More use `find` utility to find tags files
6+
// and then `grep` utility search `tagstring` object over tags files
7+
// content.
8+
19
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
210
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
311
!_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/

0 commit comments

Comments
 (0)