Git Product home page Git Product logo

rchore's People

Contributors

agrism avatar alasdair-munday avatar caioeverest avatar darthbenro008 avatar janekx21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rchore's Issues

Feature request: customize default data dir to a more sensible location (eg. ~/.config/rchore)

Files are currently at ${HOME}/.r_chore:

  • Not user-configurable.
  • Not consistent with binary/app name (ie. .rchore).
  • Follow some user data dir convention (eg XDG), instead of placing them at home's root dir (eg. ~/.config/.rchore).
  • Also, splitting credential/auth info in a separate file, would ease keeping credentials in an encrypted dir (eg. gocryptfs), outside data. Also, using env vars to auth might be an option?

segmentation fault on rchore tasks list

rchore tasks list results in zsh: segmentation fault (core dumped) cargo run -- tasks list.
I could trace the error to prettytable and its printstd function inside src/printer.rs.

Auto-fallback to list options if argument not provided

Right now you need to provide an positional argument to rchore tasks done <pos> or rchore tasks delete <pos>. It would be really nice if you could fall back to a list option presented to the user when the position is not passed, something like what already rchore task-list update or rchore task-list delete does.

Sample:
image

Relevant Codebase:

pub fn delete_task(&self, pos: usize) -> anyhow::Result<()> {
let resp = &self.client.localdb.get_data()?;
let task = resp.get(pos - 1).unwrap();
let new_resp = &self
.client
.delete_task(task.id.as_ref().unwrap().to_string());
match new_resp {
Ok(_res) => {
let _ = self
.client
.localdb
.delete_task(task.id.as_ref().unwrap().to_string());
print_success(format!("Task {} has been deleted!", &task.title))
}
Err(err) => print_error("deleting the task", err),
}
Ok(())
}
}

pub fn complete_task(&self, pos: usize, is_completed: bool) -> anyhow::Result<()> {
let resp = &self.client.localdb.get_data()?;
let mut task = resp.get(pos - 1).unwrap().clone();
task.status = if is_completed {
String::from("completed")
} else {
String::from("needsAction")
};
let new_resp = &self.client.update_task(task);
match new_resp {
Ok(task) => {
let _ = self.client.localdb.update_task(task.clone());
if is_completed {
print_success(format!("Task {} marked as completed!", task.title))
} else {
print_warning(format!("Task {} marked as incomplete!", task.title))
}
}
Err(err) => print_error("marking task complete", err),
}
Ok(())
}

Main Thread Panics at `rchore tasks list`

Platform: ArchLinux x86_64

Steps to reproduce -->

  1. Download latest release
  2. Make it executable and login using 'rchore google login'
  3. Run 'rchore tasks list'
    Expected Behaviour -->
    App retrieves and shows my tasks.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/service/google_tasks.rs:44:36
stack backtrace:
   0:     0x562029b46a60 - std::backtrace_rs::backtrace::libunwind::trace::ha5edb8ba5c6b7a6c
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x562029b46a60 - std::backtrace_rs::backtrace::trace_unsynchronized::h0de86d320a827db2
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x562029b46a60 - std::sys_common::backtrace::_print_fmt::h97b9ad6f0a1380ff
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x562029b46a60 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h14be7eb08f97fe80
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x562029b6abcf - core::fmt::write::h2ca8877d3e0e52de
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/fmt/mod.rs:1094:17
   5:     0x562029b40235 - std::io::Write::write_fmt::h64f5987220b618f4
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/io/mod.rs:1584:15
   6:     0x562029b48efb - std::sys_common::backtrace::_print::h7f1a4097308f2e0a
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x562029b48efb - std::sys_common::backtrace::print::h1f799fc2ca7f5035
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x562029b48efb - std::panicking::default_hook::{{closure}}::hf38436e8a3ce1071
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:208:50
   9:     0x562029b489cd - std::panicking::default_hook::he2f8f3fae11ed1dd
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:225:9
  10:     0x562029b4950d - std::panicking::rust_panic_with_hook::h79a18548bd90c7d4
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:591:17
  11:     0x562029b49077 - std::panicking::begin_panic_handler::{{closure}}::h212a72cc08e25126
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:495:13
  12:     0x562029b46efc - std::sys_common::backtrace::__rust_end_short_backtrace::hbd6897dd42bc0fcd
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/sys_common/backtrace.rs:141:18
  13:     0x562029b49009 - rust_begin_unwind
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:493:5
  14:     0x5620297b1191 - core::panicking::panic_fmt::h77ecd04e9b1dd84d
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:92:14
  15:     0x5620297b10dd - core::panicking::panic::h60569d8a39169222
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/panicking.rs:50:5
  16:     0x562029805672 - <rchore::service::google_api::GoogleApiClient as rchore::service::google_tasks::ApiTasks>::fetch_all_tasks::h9444ba239020bcb6
  17:     0x5620297fd55d - rchore::handlers::task_handler::TaskManager::list_tasks::h8617fc28a90a2e22
  18:     0x5620297f6a81 - rchore::main::hafafb010e2863520
  19:     0x5620297d8993 - std::sys_common::backtrace::__rust_begin_short_backtrace::h17da107c06e2973d
  20:     0x5620297d89ad - std::rt::lang_start::{{closure}}::h61e1bdee41c6de17
  21:     0x562029b49a0a - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hc4354216bf39217c
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/core/src/ops/function.rs:259:13
  22:     0x562029b49a0a - std::panicking::try::do_call::hb68eb312780385cf
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:379:40
  23:     0x562029b49a0a - std::panicking::try::h22b8e08595060b8b
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panicking.rs:343:19
  24:     0x562029b49a0a - std::panic::catch_unwind::hc64f1a6a0e71b1fc
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/panic.rs:431:14
  25:     0x562029b49a0a - std::rt::lang_start_internal::h4461fc58637f04f8
                               at /rustc/53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b/library/std/src/rt.rs:34:21
  26:     0x5620297f88e2 - main
  27:     0x7f4557c94b25 - __libc_start_main
  28:     0x5620297b190e - _start
  29:                0x0 - <unknown>

Create tasks using flags

At the moment, one needs to type rchore tasks add which brings up a prompt inorder to create tasks, we should also enable option to directly create tasks via flag arguments .

Eg:
rchore tasks add --name="task" --description="task desc" --completed=N should automatically create the task.

image

Feature Request: tui or repl interface

First of all thank-you. I haven't found any other cli tool that successfully interacts with google-tasks so keep up the good work!!

I've just started exploring rchore and probably being dumb but I'm a bit disorientated. I'm going to open a few "feature requests" about different things.

  • Is there any sort of repl/ interactive mode that might be quicker and easier to use please? Apologies I'm not a programmer or anything but: I'm thinking of something like the command prompt you get when launching a python environment.
  • I'm sure good programming methodology includes a lot of other things in a repl interface and other users would have different preferences but the main things I'd like are [1] an indication of which task-list is currently active (eg in the command prompt), which could usefully have a task count indicator and [2] tab completion on command entry.
  • Following on from a repl enviroment: A full on tui (eg like nano) would be lovely but probably over the top/ out of scope.
    thanks in advance

Feature Request/ How do I? ... edit tasks

newbie warning: I think I'm being stupid.

How can I edit a task please? If it's not currently possible then may I add that as a feature request please.

From what I can tell the subcommands under "tasks" are: list add delete show stats clear done undo.

thanks in advance

error: failed to run custom build command for `rchore v0.1.0`

running

cargo install rchore 

got:

 Updating crates.io index
  Downloaded rchore v0.1.0
  Downloaded 1 crate (433.3 KB) in 0.78s
  Installing rchore v0.1.0
  Downloaded futures-io v0.3.16
  Downloaded futures-sink v0.3.16
  Downloaded futures-util v0.3.16
  Downloaded futures-channel v0.3.16
  Downloaded socket2 v0.4.1
  Downloaded tokio v1.9.0
  Downloaded futures-core v0.3.16
  Downloaded serde_json v1.0.66
  Downloaded proc-macro2 v1.0.28
  Downloaded serde_derive v1.0.127
  Downloaded serde v1.0.127
  Downloaded cc v1.0.69
  Downloaded tinyvec v1.3.1
  Downloaded syn v1.0.74
  Downloaded futures-task v0.3.16
  Downloaded futures-macro v0.3.16
  Downloaded hyper v0.14.11
  Downloaded 17 crates (1.6 MB) in 1.20s
   Compiling libc v0.2.98
   Compiling autocfg v1.0.1
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.28
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.74
   Compiling lazy_static v1.4.0
   Compiling memchr v2.4.0
   Compiling log v0.4.14
   Compiling version_check v0.9.3
   Compiling serde_derive v1.0.127
   Compiling serde v1.0.127
   Compiling pin-project-lite v0.2.7
   Compiling bytes v1.0.1
   Compiling itoa v0.4.7
   Compiling futures-core v0.3.16
   Compiling cc v1.0.69
   Compiling proc-macro-hack v0.5.19
   Compiling core-foundation-sys v0.8.2
   Compiling bitflags v1.2.1
   Compiling spin v0.5.2
   Compiling futures-task v0.3.16
   Compiling untrusted v0.7.1
   Compiling proc-macro-nested v0.1.7
   Compiling ppv-lite86 v0.2.10
   Compiling ryu v1.0.5
   Compiling fnv v1.0.7
   Compiling hashbrown v0.11.2
   Compiling remove_dir_all v0.5.3
   Compiling httparse v1.4.1
   Compiling slab v0.4.3
   Compiling pin-utils v0.1.0
   Compiling futures-io v0.3.16
   Compiling futures-channel v0.3.16
   Compiling futures-sink v0.3.16
   Compiling matches v0.1.8
   Compiling typenum v1.13.0
   Compiling unicode-width v0.1.8
   Compiling try-lock v0.2.3
   Compiling native-tls v0.2.7
   Compiling tinyvec_macros v0.1.0
   Compiling httpdate v1.0.1
   Compiling percent-encoding v2.1.0
   Compiling base64 v0.13.0
   Compiling tower-service v0.3.1
   Compiling scopeguard v1.1.0
   Compiling byteorder v1.4.3
   Compiling crossbeam-utils v0.8.5
   Compiling encoding_rs v0.8.28
   Compiling serde_json v1.0.66
   Compiling regex-syntax v0.6.25
   Compiling unicode-segmentation v1.8.0
   Compiling crc32fast v1.2.1
   Compiling smallvec v1.6.1
   Compiling regex-automata v0.1.10
   Compiling crossbeam-epoch v0.9.5
   Compiling vec_map v0.8.2
   Compiling strsim v0.8.0
   Compiling opaque-debug v0.3.0
   Compiling ipnet v2.3.1
   Compiling dotenv v0.15.0
   Compiling anyhow v1.0.42
   Compiling ansi_term v0.11.0
   Compiling mime v0.3.16
   Compiling cpufeatures v0.1.5
   Compiling encode_unicode v0.3.6
   Compiling zeroize v1.4.1
   Compiling home v0.5.3
   Compiling instant v0.1.10
   Compiling tracing-core v0.1.18
   Compiling generic-array v0.14.4
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling tokio v1.9.0
   Compiling futures-macro v0.3.16
   Compiling futures-util v0.3.16
   Compiling indexmap v1.7.0
   Compiling num-traits v0.2.14
   Compiling memoffset v0.6.4
   Compiling num-integer v0.1.44
   Compiling http v0.2.4
   Compiling unicode-bidi v0.3.5
   Compiling textwrap v0.11.0
   Compiling tinyvec v1.3.1
   Compiling lock_api v0.4.4
   Compiling form_urlencoded v1.0.1
   Compiling fxhash v0.2.1
   Compiling heck v0.3.3
   Compiling ring v0.16.20
   Compiling rchore v0.1.0
   Compiling tracing v0.1.26
   Compiling regex v1.5.4
   Compiling want v0.3.0
   Compiling unicode-normalization v0.1.19
error: failed to run custom build command for `rchore v0.1.0`

Caused by:
  process didn't exit successfully: `/var/folders/1k/0sd0tctn1tg35t0_rv10b17w0000gq/T/cargo-installQakkJ6/release/build/rchore-5ba7dc04eb699a7e/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NotPresent', /Users/agris/.cargo/registry/src/github.com-1ecc6299db9ec823/rchore-0.1.0/build.rs:6:44
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `rchore v0.1.0`, intermediate artifacts can be found at `/var/folders/1k/0sd0tctn1tg35t0_rv10b17w0000gq/T/cargo-installQakkJ6`

Caused by:
  build failed

I appreciate any help, thanks

cargo 1.54.0 (5ae8d74b3 2021-06-22)
rustc 1.54.0 (a178d0322 2021-07-26)

Create static website based docs for rChore

Provide a nice markdown documentation either via Hugo or GitHub Pages

Requirements:

  • Keep documentation related files in docs folder
  • Describe about rChore and detailed usage examples and steps
  • Use a simple theme, if possible to go with rChore color palette
  • Add a GitHub action to generate and update the docs (static website) on release

docs: Google OAuth Danger Screen

As discussed in #21, the issue can be closed when the following tasks are achieved:

  • Create a Wiki Page / Add in documentation about the OAuth Danger Screen
  • Add a message in rchore when OAuth prompt generates the URL

rChore shows no tasks if we query for tasks after access_token has expired

  • rChore shows No tasks if we query after access_token has expired.
  • The subsequent query shows correct tasks (wrong results for first time after token expiry)

Relevant Code:

get_new_access_token(&self.localdb)?;
let token = self.localdb.get_token()?;
let new_client = GoogleApiClient::new_token_client(token);
self.client = new_client;
self.fetch_all_tasks(show_hidden)?;
return Ok(TaskResponse {
etag: "".to_string(),
kind: "".to_string(),
items: [].to_vec(),
});
}
let tasks_response = resp.json::<TaskResponse>()?;
Ok(tasks_response)

Solution:

  • Create a middleware cache check in GoogleApiClient

Add ability to mention due date in human-friendly format

Currently rChore does not accept due date for tasks

image

Feature:

It would be nice if we could take in due date in human friendly date format

Relevant Codebase:

pub fn add_task(&self) -> anyhow::Result<()> {
let title: String = Input::with_theme(&ColorfulTheme::default())
.with_prompt("Title of the task")
.with_initial_text("task")
.allow_empty(false)
.interact_text()?;
let notes: String = Input::with_theme(&ColorfulTheme::default())
.with_prompt("Note for task")
.with_initial_text("note")
.allow_empty(true)
.interact_text()?;
let items = vec!["No", "Yes"];
let completed = Select::with_theme(&ColorfulTheme::default())
.with_prompt("Is the task completed?")
.items(&items)
.default(0)
.interact_on_opt(&Term::stderr())?
.unwrap();
let status = if completed == 0 {
String::from("needsAction")
} else {
String::from("completed")
};
let task = Tasks::new(None, title, notes, status);
let resp = &self.client.add_task(task);
match resp {
Ok(task) => {
let _ = self.client.localdb.add_task(task.clone());
print_success(format!("Task {} has been created!", task.title))
}
Err(err) => print_error("creating task", err),
}
Ok(())
}

Bug: Error message by Google OAuth when logging in: "Google has not verified this application"

Dowloaded binary, ran rchore google login, pasted URL into browser.
After selecting my personal Google Account to continue, a warning (with a big, ugly, red โš ๏ธ sign) message as the above appears (albeit in my language). The message also states that "until the author has not verified this app with Google, you should not use it.".

If you click the advanced options, you can still proceed, but this looks very scary, nonetheless.

Feature Request: Support optional flag to add task to a different list without switching default list

name: Support optional flag to add task to a different list without switching default list
description: Allow the usage of a flag that allows the user to name the list that the task is added to. This would avoid the need to switch contexts if you're working on one set of tasks but something you need to do for a different one pops into your head.
title: "[Support optional flag to add task to a different list without switching default list]: "
labels: ["enhancement"]
assignees:

  • DarthBenro008
    body:
  • type: markdown
    attributes:
    value: Allow the usage of a flag that allows the user to name the list that the task is added to. This would avoid the need to switch contexts if you're working on one set of tasks but something you need to do for a different one pops into your head. Usage: rchore tasks add --list 'other list'

Various Releases for rChore

Need to figure out robust binary distribution mechanisms for rChore

The following would be nice:

  • NPM
  • Bash Script to automatically pull from GitHub Release

Optional:

  • Fedora Repository
  • Ubuntu Repository
  • Arch Repository
  • Homebrew

rchore setup fails on remote machines

This might be a question rather than an issue, so apologize in advance. I have a server where I only have ssh access. I want to install rchore there, but rchore google login fails because oauth returns a localhost url and, obviously, cannot communicate with the chore process on the server. How do I get out of this pickle?

Create README for rChore

Create an readme for rChore with the following things in mind:

  • Logo
  • Demo
  • Installation
  • p10k Installation
  • Features
  • Tech Stack
  • Contributions
  • Author
  • License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.