Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12871041
main.rs
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
827 B
Referenced Files
None
Subscribers
None
main.rs
View Options
use
clap
::
Parser
;
use
crate
::
rfc_index
::
get_rfc_index
;
use
crate
::
rfc_parser
::
Rfc
;
mod
rfc_index
;
mod
rfc_parser
;
#[derive(Debug, Parser)]
#[command(name =
"rfc-datasource"
)]
#[clap(author=
"Nasqueron project"
, version, about=
"Download and print RFC index"
, long_about=None)]
pub
struct
RfcArgs
{
/// The format string to use
#[arg(long, short = 'f')]
format
:
String
,
/// The path to the RFC index source
#[arg(long, short = 's')]
source
:
Option
<
String
>
,
}
#[tokio::main]
async
fn
main
()
{
let
args
=
RfcArgs
::
parse
();
// Will exit if argument is missing or --help/--version provided.
let
document
=
get_rfc_index
(
args
.
source
).
await
.
expect
(
"Can't read or fetch RFC index"
);
for
rfc
in
Rfc
::
parse_document
(
&
document
)
{
println
!
(
"{}"
,
rfc
.
format
(
&
args
.
format
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Mon, Nov 17, 16:05 (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3174079
Default Alt Text
main.rs (827 B)
Attached To
Mode
rDS Nasqueron Datasources
Attached
Detach File
Event Timeline
Log In to Comment