-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
749 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ members = [ | |
"clear", | ||
"coreutils_core", | ||
"cut", | ||
"csplit", | ||
"date", | ||
"du", | ||
"dirname", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ members = [ | |
"chroot", | ||
"clear", | ||
"cut", | ||
"csplit", | ||
"date", | ||
"dirname", | ||
"du", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ members = [ | |
"chroot", | ||
"clear", | ||
"cut", | ||
"csplit", | ||
"date", | ||
"dirname", | ||
"du", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ members = [ | |
"basename", | ||
"clear", | ||
"cut", | ||
"csplit", | ||
"date", | ||
"dirname", | ||
"du", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ members = [ | |
"chroot", | ||
"clear", | ||
"cut", | ||
"csplit", | ||
"date", | ||
"dirname", | ||
"du", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ members = [ | |
"chroot", | ||
"clear", | ||
"cut", | ||
"csplit", | ||
"date", | ||
"dirname", | ||
"du", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ members = [ | |
"chroot", | ||
"clear", | ||
"cut", | ||
"csplit", | ||
"date", | ||
"dirname", | ||
"du", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ members = [ | |
"chroot", | ||
"clear", | ||
"cut", | ||
"csplit", | ||
"date", | ||
"dirname", | ||
"du", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ members = [ | |
"chroot", | ||
"clear", | ||
"cut", | ||
"csplit", | ||
"date", | ||
"dirname", | ||
"du", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ members = [ | |
"chroot", | ||
"clear", | ||
"cut", | ||
"csplit", | ||
"date", | ||
"dirname", | ||
"du", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ members = [ | |
"chroot", | ||
"clear", | ||
"cut", | ||
"csplit", | ||
"date", | ||
"dirname", | ||
"du", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
name = "csplit" | ||
version = "0.1.0" | ||
authors = ["Mats Kindahl <mats.kindahl@gmail.com>"] | ||
build = "build.rs" | ||
edition = "2018" | ||
|
||
[dependencies] | ||
clap = { version = "^2.33.0", features = ["yaml", "wrap_help"] } | ||
regex = "1.3.1" | ||
|
||
[build-dependencies] | ||
clap = { version = "^2.33.0", features = ["yaml"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::env; | ||
|
||
use clap::{load_yaml, App, Shell}; | ||
|
||
fn main() { | ||
let yaml = load_yaml!("src/csplit.yml"); | ||
let mut app = App::from_yaml(yaml); | ||
|
||
let out_dir = match env::var("OUT_DIR") { | ||
Ok(dir) => dir, | ||
_ => return, | ||
}; | ||
|
||
app.gen_completions("csplit", Shell::Zsh, out_dir.clone()); | ||
app.gen_completions("csplit", Shell::Fish, out_dir.clone()); | ||
app.gen_completions("csplit", Shell::Bash, out_dir.clone()); | ||
app.gen_completions("csplit", Shell::PowerShell, out_dir.clone()); | ||
app.gen_completions("csplit", Shell::Elvish, out_dir); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: csplit | ||
version: "0.1.0" | ||
author: Mats Kindahl <mats.kindahl@gmail.com> | ||
about: |- | ||
Split FILE by each PATTERN into a series of files 'xx00', 'xx01', | ||
... | ||
A file name has to be provided, but if it is '-', input will read | ||
from standard input. | ||
The input will be split up to, but not including, the line that | ||
matches PATTERN. | ||
The number of bytes in each file will be displayed on standard | ||
output with one line for each file. | ||
after_help: |- | ||
PATTERN can be any of: | ||
INTEGER copy lines up to line number | ||
/REGEXP/[OFFSET] copy lines up to line matching REGEXP | ||
%REGEXP%[OFFSET] skip lines up to line matching REGEXP | ||
{INTEGER} repeat preceeding pattern INTEGER times | ||
{*} repeat preceeding pattern indefinitely | ||
If an OFFSET is given it should be an integer, either positive or | ||
negative. An offset without sign is assumed to be positive. | ||
args: | ||
- FILE: | ||
help: File to read, or '-' to read from standard input. | ||
required: true | ||
- PATTERN: | ||
help: Patterns to use when splitting file. | ||
multiple: true | ||
- prefix: | ||
long: prefix | ||
short: f | ||
value_name: PREFIX | ||
help: Prefix to use for written files. The default is 'xx'. | ||
- suffix-format: | ||
long: suffix-format | ||
short: b | ||
value_name: FORMAT | ||
help: Format to use for the file suffix. The default is '%02d'. | ||
- keep: | ||
long: keep-files | ||
short: k | ||
help: Do not remove output files on error. | ||
- suppress: | ||
long: suppress-matched | ||
short: x | ||
help: Suppress lines that match a PATTERN. | ||
- digits: | ||
long: digits | ||
short: n | ||
value_name: DIGITS | ||
help: Use the given number of digits for output file name. The default is 2. | ||
- silent: | ||
long: quiet | ||
long: silent | ||
short: s | ||
help: Do not print counts of output file sizes. | ||
- elide-empty: | ||
long: elide-empty-files | ||
short: z | ||
help: Remove empty output files. |
Oops, something went wrong.