Skip to content

Commit daea789

Browse files
authored
Prepare 0.1.0 (#2)
1 parent a970715 commit daea789

File tree

9 files changed

+31
-25
lines changed

9 files changed

+31
-25
lines changed

Cargo.lock

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "onlyargs"
33
description = "Obsessively tiny argument parsing"
44
version = "0.1.0"
55
authors = ["Jay Oster <[email protected]>"]
6+
repository = "https://github.com/parasyte/onlyargs"
67
edition = "2021"
78
keywords = ["cli", "arg", "argument", "parse", "parser"]
89
categories = ["command-line-interface"]

MSRV.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
| `onlyargs` version | `rustc` version |
44
|--------------------|-----------------|
55
| (unreleased) | `1.62.0` |
6+
| `0.1.0` | `1.62.0` |
67

78
## Policy
89

examples/derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ publish = false
99
error-iter = "0.4"
1010
onlyargs = { path = "../.." }
1111
onlyargs_derive = { path = "../../onlyargs_derive" }
12-
onlyerror = { git = "https://github.com/parasyte/onlyerror.git", rev = "1d25d230767e91a29040b83dbf4faf689e69a818" }
12+
onlyerror = "0.1"

examples/full.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use error_iter::ErrorIter as _;
2-
use onlyargs::{extensions::*, CliError, OnlyArgs};
2+
use onlyargs::{traits::*, CliError, OnlyArgs};
33
use std::{ffi::OsString, path::PathBuf, process::ExitCode};
44

55
#[derive(Debug)]

onlyargs_derive/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "onlyargs_derive"
33
description = "Obsessively tiny argument parsing derive macro"
44
version = "0.1.0"
55
authors = ["Jay Oster <[email protected]>"]
6+
repository = "https://github.com/parasyte/onlyargs"
67
edition = "2021"
78
keywords = ["cli", "arg", "argument", "parse", "parser"]
89
categories = ["command-line-interface"]
@@ -12,5 +13,5 @@ license = "MIT"
1213
proc-macro = true
1314

1415
[dependencies]
15-
myn = { git = "https://github.com/parasyte/myn.git", rev = "c86196dc061a2bea10363c9ed3fb7091a70e3984" }
16+
myn = "0.1"
1617
onlyargs = { version = "0.1", path = ".." }

onlyargs_derive/src/lib.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//!
1616
//! # Provided arguments
1717
//!
18-
//! `--help` and `--version` arguments are automatically generated. When the parser encounters
18+
//! `--help|-h` and `--version|-V` arguments are automatically generated. When the parser encounters
1919
//! either, it will print the help or version message and exit the application with exit code 0.
2020
//!
2121
//! # Field attributes
@@ -33,27 +33,27 @@
3333
//!
3434
//! Here is the list of supported field "primitive" types:
3535
//!
36-
//! | Type | Description |
37-
//! |---------------|--------------------------------------------------|
38-
//! | `bool` | Defines a flag. |
39-
//! | `f32|f64` | Floating point number option. |
40-
//! | `i8|u8` | 8-bit integer option. |
41-
//! | `i16|u16` | 16-bit integer option. |
42-
//! | `i32|u32` | 32-bit integer option. |
43-
//! | `i64|u64` | 64-bit integer option. |
44-
//! | `i128|u128` | 128-bit integer option. |
45-
//! | `isize|usize` | Pointer-sized integer option. |
46-
//! | `OsString` | A string option with platform-specific encoding. |
47-
//! | `PathBuf` | A file system path option. |
48-
//! | `String` | UTF-8 encoded string option. |
36+
//! | Type | Description |
37+
//! |------------------|--------------------------------------------------|
38+
//! | `bool` | Defines a flag. |
39+
//! | `f32`\|`f64` | Floating point number option. |
40+
//! | `i8`\|`u8` | 8-bit integer option. |
41+
//! | `i16`\|`u16` | 16-bit integer option. |
42+
//! | `i32`\|`u32` | 32-bit integer option. |
43+
//! | `i64`\|`u64` | 64-bit integer option. |
44+
//! | `i128`\|`u128` | 128-bit integer option. |
45+
//! | `isize`\|`usize` | Pointer-sized integer option. |
46+
//! | `OsString` | A string option with platform-specific encoding. |
47+
//! | `PathBuf` | A file system path option. |
48+
//! | `String` | UTF-8 encoded string option. |
4949
//!
5050
//! Additionally, some wrapper and composite types are also available, where the type `T` must be
5151
//! one of the primitive types listed above.
5252
//!
53-
//! | Type | Description |
54-
//! |---------------|-----------------------------------|
55-
//! | `Option<T>` | An optional argument. |
56-
//! | `Vec<T>` | Positional arguments (see below). |
53+
//! | Type | Description |
54+
//! |-------------|-----------------------------------|
55+
//! | `Option<T>` | An optional argument. |
56+
//! | `Vec<T>` | Positional arguments (see below). |
5757
//!
5858
//! In argument parsing parlance, "flags" are simple boolean values; the argument does not require
5959
//! a value. For example, the argument `--help`.
@@ -303,7 +303,7 @@ pub fn derive_parser(input: TokenStream) -> TokenStream {
303303
);
304304
305305
fn parse(args: Vec<std::ffi::OsString>) -> Result<Self, ::onlyargs::CliError> {{
306-
use ::onlyargs::extensions::*;
306+
use ::onlyargs::traits::*;
307307
308308
{flags_vars}
309309
{options_vars}

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::env;
1717
use std::ffi::OsString;
1818
use std::fmt::Display;
1919

20-
pub mod extensions;
20+
pub mod traits;
2121

2222
/// Argument parsing errors.
2323
#[derive(Debug)]
@@ -94,6 +94,7 @@ pub trait OnlyArgs {
9494
std::process::exit(0);
9595
}
9696
}
97+
9798
impl Display for CliError {
9899
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
99100
match self {
File renamed without changes.

0 commit comments

Comments
 (0)