Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/man page #52

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,56 @@ Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# # Compiled Java class files
# *.class

# # Compiled Python bytecode
# *.py[cod]

# # Log files
# *.log

# # Package files
# *.jar

# # Maven
# target/
# dist/

# # JetBrains IDE
# .idea/

# # Unit test reports
# TEST*.xml

# # Generated by MacOS
# .DS_Store

# # Generated by Windows
# Thumbs.db

# # Applications
# *.app
# *.exe
# *.war

# # Large media files
# *.mp4
# *.tiff
# *.avi
# *.flv
# *.mov
# *.wmv

# # Data
# *.csv
# *.xls
# *.xlsx
# *.zip

# # Pickle files
# .pkl

# # Visualizations
# .png
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ snmp-data-parser = { path = "./crates/snmp-data-parser" }
rasn-snmp = { path = "./crates/rasn/standards/snmp" }
rasn-smi = { path = "./crates/rasn/standards/smi" }
rasn = { path = "./crates/rasn" }
clap = { version = "3.2.6", features = ["derive"] }

actix = "0.13"
actix-web = { version = "4.1", default_features = false, features = [
Expand Down Expand Up @@ -133,3 +134,7 @@ members = [

[patch.crates-io]
paperclip = { git = "https://github.com/sonalake/paperclip", branch = "master" }

[build-dependencies]
clap_mangen = "0.1"
clap = "3.2"
conor-sonalake marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 16 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
// generated by `sqlx migrate build-script`
fn main() {
fn main() -> std::io::Result<()> {
// trigger recompilation when a new migration is added
println!("cargo:rerun-if-changed=migrations");
// println!("cargo:rerun-if-changed=migrations");
conor-sonalake marked this conversation as resolved.
Show resolved Hide resolved

let man_dir = std::path::PathBuf::from(std::env::var_os("MAN_DIR").ok_or_else(|| std::io::ErrorKind::NotFound)?);

let cmd = clap::Command::new("mybin")
frankhorv marked this conversation as resolved.
Show resolved Hide resolved
.arg(clap::arg!(-n --name <NAME>))
.arg(clap::arg!(-c --count <NUM>));

let man = clap_mangen::Man::new(cmd);
let mut buffer: Vec<u8> = Default::default();
man.render(&mut buffer)?;

std::fs::write(man_dir.join("mybin.1"), buffer)?;

Ok(())
}
Binary file added snmp-sim.db
Binary file not shown.
Binary file added snmp-sim.db-shm
Binary file not shown.
Empty file added snmp-sim.db-wal
Empty file.