From de5ae8656387267bb4614bbab6b62784323f23c0 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Sun, 26 Mar 2017 17:31:28 -0700 Subject: Discover and open nictrokey using libhidapi This change uses the 'hid' crate to discover and open the Nitrokey Storage device. 'hid' is a wrapper around libhidapi (its libusb back-end in particular). Being a command line application some sort of parameter handling needs to happen. The approach we take is very simple for now to minimize the number of dependencies: we just compare the first argument against the expected ones and raise an error if no match was found. Because we only have positional arguments right now this is all we need. --- nitrocli/Cargo.toml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'nitrocli/Cargo.toml') diff --git a/nitrocli/Cargo.toml b/nitrocli/Cargo.toml index ceaf276..1ee63fb 100644 --- a/nitrocli/Cargo.toml +++ b/nitrocli/Cargo.toml @@ -29,3 +29,25 @@ keywords = ["hid", "nitrokey", "nitrokey-storage", "usb", "cli"] description = """ A command line tool for interacting with the Nitrokey Storage device. """ + +[dependencies.gcc] +path = "../gcc" + +[dependencies.hid] +path = "../hid" + +[dependencies.hidapi-sys] +path = "../hidapi-sys" + +[dependencies.libc] +path = "../libc" + +[dependencies.pkg-config] +path = "../pkg-config" + +[replace] +"gcc:0.3.45" = { path = "../gcc" } +"hid:0.3.0" = { path = "../hid" } +"hidapi-sys:0.1.2" = { path = "../hidapi-sys" } +"libc:0.2.21" = { path = "../libc" } +"pkg-config:0.3.9" = { path = "../pkg-config" } -- cgit v1.2.1