Add ktool - #55
Add ktool#55
Conversation
| { | ||
| if let Some(path) = entry.0.path().to_str() { | ||
| println!("{path}:"); | ||
| if let Err(e) = super::cc_file::dump(path) { |
There was a problem hiding this comment.
If we wanted to make this a bit more generic, it should be that given a ccache spec, we return an iterator over cc items, and then the caller is responsible to call .dump(), or any other things they may want to do.
|
|
||
| impl fmt::Display for KeyBlockV4 { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| write!(f, "[{}] {}", self.enc_type, self.data) |
There was a problem hiding this comment.
I don't recall, is KeyBlock a private key?
There was a problem hiding this comment.
It is the session key
There was a problem hiding this comment.
Should we be hiding this then?
| let ccache_name = parse_ccache_name(ccache_name); | ||
|
|
||
| if ccache_name.starts_with("FILE:") { | ||
| return cc_file::dump(ccache_name.as_str()); |
There was a problem hiding this comment.
See above comment, we already know the type here when we call dump, so why not split here?
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
|
Pushed an update, dump() is a trait fn now and I added collection iterators. |
Firstyear
left a comment
There was a problem hiding this comment.
Minor comment but otherwise looks good :)
|
|
||
| impl fmt::Display for KeyBlockV4 { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| write!(f, "[{}] {}", self.enc_type, self.data) |
There was a problem hiding this comment.
Should we be hiding this then?
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
Signed-off-by: Samuel Cabrero <scabrero@suse.com>
…ction Signed-off-by: Samuel Cabrero <scabrero@suse.com>
|
KeyBlock only printed if |
Only 'ccahe dump' subcommand for now.