GithubHelp home page GithubHelp logo

sqrtiswap / todo Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 125 KB

Purely POSIX rewrite/replacement for todo.txt-cli (moved to SourceHut)

Home Page: https://git.sr.ht/~xan/todo

License: ISC License

Makefile 1.09% Shell 66.55% Roff 32.36%

todo's Introduction

todo

todo.txt-cli replacement with a focus on portability

Some introductory remarks that can be safely skipped

Why?

I happily used todo.txt-cli until 2019 when I started using OpenBSD. With OpenBSD by default using ksh(1) instead of bash(1) the script didn't work anymore - which of course isn't a big surprise.

But even after installing bash(1) it still didn't work. Looking back I have no idea why that was the case but at that time it looked like todo.txt-cli was not just bash(1) specific but even specific to specific bash(1) versions/ports.

When I looked at the code I was shocked even more at some of the design decisions (I don't think I would judge it so harshly nowadays but I did then) and therefore decided to write my own replacement with a focus on portability.

Why and how purely POSIX?

By now this is also kind of a proof of principle to see if I can implement everything I want in a purely POSIX way. Hence I made some decisions that might themselves seem weird/shocking, e.g.:

  • The -i flag is an extension to sed(1) and therefore not allowed. ed(1) to the rescue! ;)
  • The -j in MacOS and -d in GNU date(1) one might want to use for date comparisons are extensions, so expr(1) is needed.

This also means: If it doesn't work for your obscure (but POSIX compliant) system, please tell me about it and I'll get it working.

Differences to todo.txt-cli

  • Not all features are available, only those I care about.
  • Some additional features exist because I care about them.
  • The features both scripts share may be behind different flags and commands. I just didn't care about keeping the same syntax. Sometimes a different command also made more sense, e.g. since I wanted to (in most cases) be able to use single-letter-commands as abbreviations for the full commands I changed add to create in order for add and append not to conflict. For more details see the documentation.
  • In the official todo.txt format rules the creation date is an option, in todo(1) it's always added. This is also the case for the completion date as well as the priority.
  • Furthermore the order of priority and completion date in done.txt is reversed, e.g. an entry might be x 2023-06-21 (C) 2023-06-20 Do this thing @context +project due:2023-06-21.

Installation

make

will move todo to ~/bin/ and the manpage to ~/man/man1/. You may need to update your MANPATH.

Removal

make uninstall

Documentation

RTFM

Contributing

Contributions are welcome. Please review these guidelines beforehand.

  • Shell code should be strictly following the POSIX standard without relying on syntax or commands of other shells. That's kinda the point of this project.
  • Send a coherent commit history, making sure each individual commit is meaningful.
  • You may need to rebase to avoid merge conflicts.
  • If you are changing the behavior, you may need to update the manpage. You may want to check the mdoc(7) manpage for the syntax.
  • Tools meant for inclusion in contrib/ may be written in any language following whatever coding style you prefer. But you might want to include a comment about the purpose of your tool, especially if the code is complex and difficult to understand at a glance.

Licence

ISC

todo's People

Contributors

sqrtiswap avatar

Watchers

 avatar

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.