Giter Site home page Giter Site logo

rustcoreutils / posixutils-rs Goto Github PK

View Code? Open in Web Editor NEW
14.0 1.0 7.0 475 KB

Core POSIX command line utilities in safe Rust

License: MIT License

Rust 100.00%
coreutils coreutils-programs posix posix-compatible posix-compliance posix-compliant rust rust-lang

posixutils-rs's Introduction

posixutils-rs

This is a suite of Rust-native core command line utilties (cp, mv, rm, ls, ...) using SuSv3 as the base POSIX specification.

Goals

The goal is to create clean, race-free userland utilities that are POSIX compliant, maximizing compatibility with existing shell scripts while minimizing bloat.

Implementation goals include clean, safe Rust code and maximal use of Rust community crates. This project's utilities should "look like normal Rust programs."

Contributions are welcome. Developers and helpers, please read CONTRIBUTING for details.

Core specification: https://pubs.opengroup.org/onlinepubs/9699919799/

Non-goals

It is not a goal to be compatible with GNU utilities, which are sometimes viewed as bloated and overloaded with rarely-used options.

Popular GNU options will be supported by virtue of the "don't break scripts" rule. Unpopular options will not be implemented, to prevent bloat.

Similar projects

A similar project with the aim of GNU compatibility is https://github.com/uutils/coreutils

A similar project from the author, written in C++, is https://github.com/jgarzik/posixutils

Checklist of utilities

  • admin (SCCS)
  • ar (Development)
  • asa
  • at (cron cat.)
  • awk
  • basename
  • batch (cron cat.)
  • bc
  • c99 (Development)
  • cal
  • cat
  • cflow (Development)
  • chgrp
  • chmod
  • chown
  • cksum
  • cmp
  • comm
  • compress (compress cat.)
  • cp
  • crontab (cron cat.)
  • csplit
  • ctags (Development)
  • cut
  • cxref (Development)
  • date
  • dd
  • delta (SCCS)
  • df
  • diff
  • dirname
  • du
  • echo
  • ed
  • env
  • ex
  • expand
  • expr
  • false
  • file
  • find
  • fold
  • fort77 (Development)
  • fuser
  • gencat (i18n)
  • get (SCCS)
  • getconf
  • grep
  • head
  • iconv (i18n)
  • id
  • ipcrm (IPC)
  • ipcs (IPC)
  • join
  • kill
  • lex (Development)
  • link
  • ln
  • locale
  • localedef
  • logger
  • logname
  • lp
  • ls
  • m4
  • mailx
  • make
  • man
  • mesg
  • mkdir
  • mkfifo
  • more
  • mv
  • newgrp
  • nice
  • nl
  • nm (Development)
  • nohup
  • od
  • paste
  • patch
  • pathchk
  • pax
  • pr
  • printf
  • prs (SCCS)
  • ps
  • pwd
  • qalter (Batch cat.)
  • qdel (Batch cat.)
  • qhold (Batch cat.)
  • qmove (Batch cat.)
  • qmsg (Batch cat.)
  • qrerun (Batch cat.)
  • qrls (Batch cat.)
  • qselect (Batch cat.)
  • qsig (Batch cat.)
  • qstat (Batch cat.)
  • qsub (Batch cat.)
  • renice
  • rm
  • rmdel (SCCS)
  • rmdir
  • sact (SCCS)
  • sccs (SCCS)
  • sed
  • sh
  • sleep
  • sort
  • split
  • strings
  • strip (Development)
  • stty
  • tabs
  • tail
  • talk
  • tee
  • test
  • time
  • touch
  • tput
  • tr
  • true
  • tsort
  • tty
  • uname
  • uncompress (compress cat.)
  • unexpand
  • unget (SCCS)
  • uniq
  • unlink
  • uucp (UUCP)
  • uudecode (uue)
  • uuencode (uue)
  • uustat (UUCP)
  • uux (UUCP)
  • val (SCCS)
  • vi
  • wc
  • what (SCCS)
  • who
  • write
  • xargs
  • yacc (Development)
  • zcat (compress cat.)

posixutils-rs's People

Contributors

jgarzik avatar jrf63 avatar rishadbaniya avatar

Stargazers

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

Watchers

 avatar

posixutils-rs's Issues

Create integration tests for "rmdir" utility

The rmdir utility found in tree/src/rmdir.rs lacks integration tests.

Create a new set of integration tests in tree/tests/rmdir-tests.rs. Test both with and without -p. Ensure negative tests exist, testing failure conditions, as well as positive tests. Test with zero, one and multiple pathnames on the command line. Verify that the utility CLI exit code is POSIX compliant and correct in all cases.

Development utilities

Implement development utilities:

  • ar
  • c99
  • cflow
  • ctags
  • cxref
  • fort77
  • lex
  • make
  • nm
  • strings
  • strip
  • yacc

Localization (i18n): notes and planning

Introduction

Soliciting discussion over the localization (i18n) strategy for this project.

Goals

Goal 1: Localize everything

The goal is complete localization of all messages visible to the user, within the bounds of POSIX compliance:

  • All util messages, collation sequences, charsets and other util i18n details
  • All --help messages and related output (clap crate)
  • All OS error messages (io::Result)
  • It is believed that some minimum set of strings are required to be English/POSIX permanently. Minimize this POSIX-only set as much as possible.

Goal 2: Encourage UTF-8

To be forward-looking, this project looks for opportunities to

  • Drop support for non-UTF 8 strings
  • Default to UTF-8 charsets and strings

This project should aggressively interpret the POSIX standards in terms of UTF-8 support, and look for opportunities to create default-UTF-8 operating modes, with a fallback mode that is "POSIX-ly correct."

Implementation strategies

Current strategy

The current strategies are,

  • use the gettext crate, and mark strings with gettext(). This provides a starting point for per-util coding, and at least gets us started on the road to i18n.
  • each util sets the charset thusly,
    bind_textdomain_codeset(PROJECT_NAME, "UTF-8")?;

Improvements to our i18n

At present, OS error messages and --help are not translated at all, and need a project-wide strategy.

Also, one idea that is aligned with the gencat util is to generate catgets message catalogs and abandon gettext. This works because catgets exists on all modern platforms.

See issue #65 for util-related tasks.

Feedback and thoughts are requested. We want to give users the best i18n support possible.

SCCS utilities

Implement SCCS utilities:

  • admin
  • delta
  • get
  • prs
  • rmdel
  • sact
  • sccs
  • unget
  • val
  • what

Cron and Batch utilities

Implement cron and batch-related utilities:

  • cron daemon. While not specified, its need is implied and worth building.
  • at
  • batch
  • crontab
  • qalter
  • qdel
  • qhold
  • qmove
  • qmsg
  • qrerun
  • qrls
  • qselect
  • qsig
  • qstat
  • qsub

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.