-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
15cb1a0
commit c3604c2
Showing
7 changed files
with
142 additions
and
139 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
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
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
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,30 @@ | ||
// config struct for the flags package argument parser | ||
const Cmd = @This(); | ||
|
||
server: []const u8 = "pool.ntp.org", | ||
port: u16 = 123, | ||
protocol_version: u8 = 4, | ||
all: bool = false, | ||
src_ip: []const u8 = "0.0.0.0", | ||
src_port: u16 = 0, | ||
timezone: []const u8 = "UTC", | ||
|
||
pub const name = "ntp_client"; | ||
|
||
pub const descriptions = .{ | ||
.server = "NTP server to query (default: pool.ntp.org)", | ||
.port = "UDP port to use for NTP query (default: 123).", | ||
.protocol_version = "NTP protocol version, 3 or 4 (default: 4).", | ||
.all = "Query all IP addresses found for a given server URL (default: false / stop after first).", | ||
.src_ip = "IP address to use for sending the query (default: 0.0.0.0 / auto-select).", | ||
.src_port = "UDP port to use for sending the query (default: 0 / any port).", | ||
.timezone = "Timezone to use in results display (default: UTC)", | ||
}; | ||
|
||
pub const switches = .{ | ||
.server = 's', | ||
.port = 'p', | ||
.protocol_version = 'v', | ||
.all = 'a', | ||
.timezone = 'z', | ||
}; |
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
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
Oops, something went wrong.