Skip to content

Commit

Permalink
Made some minor changes to the statime binary to improve ux.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidv1992 authored and rnijveld committed Nov 20, 2023
1 parent bec8c5a commit c856131
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 30 deletions.
25 changes: 0 additions & 25 deletions config.toml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/man/statime-linux.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ title: STATIME-LINUX(8) statime 0.1.0 | statime
# OPTIONS
`-c` *path*, `--config`=*path*
: Path to the configuration file for the statime-linux daemon. If not
specified this defaults to `config.toml` in the current working directory.
specified this defaults to `/etc/statime/statime.toml`.

`-h`, `--help`
: Display usage instructions.
Expand Down
3 changes: 1 addition & 2 deletions docs/precompiled/man/statime-linux.8
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
.TP
\f[V]-c\f[R] \f[I]path\f[R], \f[V]--config\f[R]=\f[I]path\f[R]
Path to the configuration file for the statime-linux daemon.
If not specified this defaults to \f[V]config.toml\f[R] in the current
working directory.
If not specified this defaults to \f[V]/etc/statime/statime.toml\f[R].
.TP
\f[V]-h\f[R], \f[V]--help\f[R]
Display usage instructions.
Expand Down
4 changes: 3 additions & 1 deletion statime-linux/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name = "statime-linux"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "statime"
path = "src/main.rs"

[dependencies]
arrayvec = { version = "0.7.4", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions statime-linux/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub struct Config {
}

#[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
pub struct PortConfig {
pub interface: InterfaceName,
#[serde(default, deserialize_with = "deserialize_acceptable_master_list")]
Expand Down
6 changes: 5 additions & 1 deletion statime-linux/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ impl clap::builder::TypedValueParser for SdoIdParser {
#[clap(author, version, about, long_about = None)]
pub struct Args {
/// Configuration file to use
#[clap(long = "config", short = 'c', default_value = "config.toml")]
#[clap(
long = "config",
short = 'c',
default_value = "/etc/statime/statime.toml"
)]
config_file: Option<PathBuf>,
}

Expand Down
12 changes: 12 additions & 0 deletions statime.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
loglevel = "info" # Other values include trace, debug, warn and error

# which ptp network to participate in?
sdo-id = 0
domain = 0

# Add one of these per network interface in your system
#[[port]]
#interface = "<interfacename>"
#network-mode = "ipv4" #can also be ipv6 or ethernet
# If the network interface has hardware clock support, you can enable it with
#hardware-clock = "/dev/ptp<hardware clock number>"

0 comments on commit c856131

Please sign in to comment.