flagon-io
/
hello
/
Code
⌘K
Docs
Sign in
flagon-io
/
hello
public
Greets people from the command line. The sample repository for g1t.
Files
Commits
Branches
(soon)
Tags
(soon)
Compare
(soon)
Docs
(soon)
hello
/
src
/
main.rs
12 lines
270 bytes
Code
Blame
1
use
std
::
env
;
2
3
use
hello
::
greeting
;
4
5
fn
main
()
{
6
// The name given, or whoever is signed in.
7
let
name
=
env
::
args
()
8
.
nth
(
1
)
9
.
or_else
(
||
env
::
var
(
"
USER
"
)
.
ok
())
10
.
unwrap_or_else
(
||
"
world
"
.
to_owned
());
11
println!
(
"
{}
"
,
greeting
(
&
name
));
12
}