summaryrefslogtreecommitdiffstats
path: root/vendor/xflags/examples/immediate-mode.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/xflags/examples/immediate-mode.rs')
-rw-r--r--vendor/xflags/examples/immediate-mode.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/xflags/examples/immediate-mode.rs b/vendor/xflags/examples/immediate-mode.rs
new file mode 100644
index 000000000..ee3baa3de
--- /dev/null
+++ b/vendor/xflags/examples/immediate-mode.rs
@@ -0,0 +1,16 @@
+use std::path::PathBuf;
+
+fn main() {
+ let flags = xflags::parse_or_exit! {
+ /// Remove directories and their contents recursively.
+ optional -r,--recursive
+ /// File or directory to remove
+ required path: PathBuf
+ };
+
+ println!(
+ "removing {}{}",
+ flags.path.display(),
+ if flags.recursive { "recursively" } else { "" },
+ )
+}