mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-22 12:54:59 +00:00
New dbg function
This commit is contained in:
parent
b0812d6b7b
commit
580d9ebcf1
10
src/main.rs
10
src/main.rs
@ -12,6 +12,16 @@ use clap::crate_version;
|
|||||||
use std::fs::OpenOptions;
|
use std::fs::OpenOptions;
|
||||||
use std::io::{self, Read, Write};
|
use std::io::{self, Read, Write};
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
fn dbg(msg: &str) {
|
||||||
|
let mut file = std::fs::OpenOptions::new()
|
||||||
|
.append(true)
|
||||||
|
.open("/tmp/thumbs.log")
|
||||||
|
.expect("Unable to open log file");
|
||||||
|
|
||||||
|
writeln!(&mut file, "{}", msg).expect("Unable to write log file");
|
||||||
|
}
|
||||||
|
|
||||||
fn app_args<'a>() -> clap::ArgMatches<'a> {
|
fn app_args<'a>() -> clap::ArgMatches<'a> {
|
||||||
App::new("thumbs")
|
App::new("thumbs")
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
|
@ -43,6 +43,16 @@ impl Executor for RealShell {
|
|||||||
|
|
||||||
const TMP_FILE: &str = "/tmp/thumbs-last";
|
const TMP_FILE: &str = "/tmp/thumbs-last";
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
fn dbg(msg: &str) {
|
||||||
|
let mut file = std::fs::OpenOptions::new()
|
||||||
|
.append(true)
|
||||||
|
.open("/tmp/thumbs.log")
|
||||||
|
.expect("Unable to open log file");
|
||||||
|
|
||||||
|
writeln!(&mut file, "{}", msg).expect("Unable to write log file");
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Swapper<'a> {
|
pub struct Swapper<'a> {
|
||||||
executor: Box<&'a mut dyn Executor>,
|
executor: Box<&'a mut dyn Executor>,
|
||||||
dir: String,
|
dir: String,
|
||||||
|
Loading…
Reference in New Issue
Block a user