about summary refs log tree commit diff
path: root/library/std/src/sys/args/mod.rs
diff options
context:
space:
mode:
authorThalia Archibald <thalia@archibald.dev>2025-04-12 02:26:17 -0700
committerThalia Archibald <thalia@archibald.dev>2025-04-12 03:10:21 -0700
commit6ffebb65d6daf4fcc82cfc7fd14397bff98df1f2 (patch)
treea0cf46afbbf6c9c39cd249a175520e2f5fe594bb /library/std/src/sys/args/mod.rs
parent1bc56185ee257ed829a0aea7abdc3b03c5fed887 (diff)
downloadrust-6ffebb65d6daf4fcc82cfc7fd14397bff98df1f2.tar.gz
rust-6ffebb65d6daf4fcc82cfc7fd14397bff98df1f2.zip
Move args into std::sys
Diffstat (limited to 'library/std/src/sys/args/mod.rs')
-rw-r--r--library/std/src/sys/args/mod.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/library/std/src/sys/args/mod.rs b/library/std/src/sys/args/mod.rs
new file mode 100644
index 00000000000..6edcafe2c4c
--- /dev/null
+++ b/library/std/src/sys/args/mod.rs
@@ -0,0 +1,34 @@
+//! Platform-dependent command line arguments abstraction.
+
+#![forbid(unsafe_op_in_unsafe_fn)]
+
+cfg_if::cfg_if! {
+    if #[cfg(target_family = "unix")] {
+        mod unix;
+        pub use unix::*;
+    } else if #[cfg(target_family = "windows")] {
+        mod windows;
+        pub use windows::*;
+    } else if #[cfg(target_os = "hermit")] {
+        mod hermit;
+        pub use hermit::*;
+    } else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] {
+        mod sgx;
+        pub use sgx::*;
+    } else if #[cfg(target_os = "uefi")] {
+        mod uefi;
+        pub use uefi::*;
+    } else if #[cfg(target_os = "wasi")] {
+        mod wasi;
+        pub use wasi::*;
+    } else if #[cfg(target_os = "xous")] {
+        mod xous;
+        pub use xous::*;
+    } else if #[cfg(target_os = "zkvm")] {
+        mod zkvm;
+        pub use zkvm::*;
+    } else {
+        mod unsupported;
+        pub use unsupported::*;
+    }
+}