]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/environment/environment-docs.factor
stomp.cli: simplify
[factor.git] / basis / environment / environment-docs.factor
index 8e5ef8b352f21f6e087516e09abb2fd055d87c4f..71d4b4f06f75eeb8dc016725097a50342e206635 100644 (file)
@@ -1,19 +1,18 @@
 ! Copyright (C) 2008 Doug Coleman.
-! See http://factorcode.org/license.txt for BSD license.
+! See https://factorcode.org/license.txt for BSD license.
 USING: assocs help.markup help.syntax io.streams.string
 libc sequences strings ;
 IN: environment
 
 HELP: (os-envs)
 { $values
-
-     { "seq" sequence } }
+    { "seq" sequence } }
 { $description "Returns a sequence of key/value pairs from the operating system." }
 { $notes "In most cases, use " { $link os-envs } " instead." } ;
 
 HELP: (set-os-envs)
 { $values
-     { "seq" sequence } }
+    { "seq" sequence } }
 { $description "Low-level word for replacing the current set of environment variables." }
 { $notes "In most cases, use " { $link set-os-envs } " instead." } ;
 
@@ -31,7 +30,7 @@ HELP: os-env
 } ;
 
 HELP: change-os-env
-{ $values { "key" string } { "quot" { $quotation "( old -- new )" } } }
+{ $values { "key" string } { "quot" { $quotation ( old -- new ) } } }
 { $description "Applies a quotation to change the value stored in an environment variable." }
 { $examples
     "This is an operating system-specific feature. On Unix, you can do:"
@@ -81,7 +80,11 @@ HELP: unset-os-env
     "Names and values of environment variables are operating system-specific."
 } ;
 
-{ os-env os-envs set-os-env unset-os-env set-os-envs set-os-envs-pointer change-os-env } related-words
+HELP: with-os-env
+{ $values { "value" string } { "key" string } { "quot" "quotation" } }
+{ $description "Calls a quotation with the " { $snippet "key" } " environment variable set to " { $snippet "value" } ", resetting the environment variable afterwards to its previous value." } ;
+
+{ os-env os-envs set-os-env unset-os-env set-os-envs set-os-envs-pointer change-os-env with-os-env } related-words
 
 
 ARTICLE: "environment" "Environment variables"