···55mod client;
66mod convert;
77mod dbus_type;
88+mod introspection;
89910use config::*;
1011use client::*;
···18191920impl Plugin for NuPluginDbus {
2021 fn signature(&self) -> Vec<PluginSignature> {
2222+ macro_rules! str {
2323+ ($s:expr) => (Value::string($s, Span::unknown()))
2424+ }
2125 vec![
2226 PluginSignature::build("dbus")
2327 .is_dbus_command()
···2933 .extra_usage("Returns an array if the method call returns more than one value.")
3034 .named("timeout", SyntaxShape::Duration, "How long to wait for a response", None)
3135 .named("signature", SyntaxShape::String,
3232- "Signature of the arguments to send, in D-Bus format\n\
3333- If not provided, they will be guessed automatically (but poorly)", None)
3434- .switch("no-flatten", "Always return a list of all return values", None)
3636+ "Signature of the arguments to send, in D-Bus format.\n \
3737+ If not provided, they will be determined from introspection.\n \
3838+ If --no-introspect is specified and this is not provided, they will \
3939+ be guessed (poorly)", None)
4040+ .switch("no-flatten",
4141+ "Always return a list of all return values", None)
4242+ .switch("no-introspect",
4343+ "Don't use introspection to determine the correct argument signature", None)
3544 .required_named("dest", SyntaxShape::String,
3645 "The name of the connection to send the method to",
3746 None)
···4958 /org/freedesktop/DBus org.freedesktop.DBus.Peer Ping".into(),
5059 description: "Ping the D-Bus server itself".into(),
5160 result: None
5252- }
6161+ },
6262+ PluginExample {
6363+ example: "dbus call --dest=org.mpris.MediaPlayer2.spotify \
6464+ /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties Get \
6565+ org.mpris.MediaPlayer2.Player Metadata".into(),
6666+ description: "Get the currently playing song in Spotify".into(),
6767+ result: Some(Value::record(nu_protocol::record!(
6868+ "xesam:title" => str!("Birdie"),
6969+ "xesam:artist" => Value::list(vec![
7070+ str!("LOVE PSYCHEDELICO")
7171+ ], Span::unknown()),
7272+ "xesam:album" => str!("Love Your Love"),
7373+ "xesam:url" => str!("https://open.spotify.com/track/51748BvzeeMs4PIdPuyZmv"),
7474+ ), Span::unknown()))
7575+ },
7676+ PluginExample {
7777+ example: "dbus call --dest=org.freedesktop.Notifications \
7878+ /org/freedesktop/Notifications org.freedesktop.Notifications \
7979+ Notify \"Floppy disks\" 0 \"media-floppy\" \"Rarely seen\" \
8080+ \"But sometimes still used\" [] {} 5000".into(),
8181+ description: "Show a notification on the desktop for 5 seconds".into(),
8282+ result: None
8383+ },
5384 ]),
5485 ]
5586 }