Modern Command-Line Rust
Smith Stallard
Sold by PBShop.store US, Wood Dale, IL, U.S.A.
AbeBooks Seller since 7 April 2005
New - Soft cover
Condition: New
Ships within U.S.A.
Quantity: Over 20 available
Add to basketSold by PBShop.store US, Wood Dale, IL, U.S.A.
AbeBooks Seller since 7 April 2005
Condition: New
Quantity: Over 20 available
Add to basketNew Book. Shipped from UK. THIS BOOK IS PRINTED ON DEMAND. Established seller since 2000.
Seller Inventory # L0-9798257402562
Here it is.
Modern Command-Line Rust: A Practical Guide to Tools and Automation
You've written the tool. It works on your machine. Then it goes into CI, or someone else's environment, or a pipeline you didn't design, and something breaks in a way you can't immediately explain. The binary assumes a TTY that isn't there. Color codes leak into downstream parsers. A panic dumps an unhelpful stack trace into a log that a JSON processor was expecting to be clean. The tool wasn't wrong, exactly. It just wasn't ready for the world it entered.
This is the problem that most Rust CLI tutorials don't address—because tutorials test in controlled conditions, and real tools don't live there.
Modern Command-Line Rust was written from the other side of those failures. Not from a position of theoretical best practices, but from years of building tools that broke in production, maintaining scripts that grew beyond what scripts were meant to hold, and learning—sometimes slowly—what separates a CLI that people actually use from one that gets quietly abandoned after the second edge case.
The tools that survive aren't always the fastest. They aren't always the most featureful. They're the ones that behave correctly when the environment isn't what the author expected. They compose cleanly with other tools without corrupting data. They fail clearly, with messages that tell you what happened and why, instead of swallowing errors or panicking into silence. They start fast, stay predictable, and don't surprise users who aren't looking for surprises.
Getting there requires making decisions that most documentation glosses over—when to check for a TTY and change behavior accordingly, how to structure a project so it stays maintainable past the first thousand lines, how to handle dependencies without accumulating invisible risk, how to write error types that carry meaning instead of just propagating noise, how to make a tool portable across environments you don't control. These decisions are rarely the exciting ones. They're the ones that determine whether a tool earns a permanent place in someone's workflow or gets replaced the first time it misbehaves.
This book works through all of it. Project structure that doesn't collapse as the codebase grows. Cargo beyond cargo build—workspaces, profiles, dependency auditing, reproducible builds. Argument parsing that handles the edge cases clap's documentation mentions but doesn't fully explain. Output that knows whether it's talking to a human or a pipeline. Error handling that communicates rather than just propagates. Performance that's real and felt, not just visible in benchmarks. Distribution that actually works on the target machines.
Along the way it draws on tools like ripgrep, fd, and bat—not as things to admire from a distance, but as case studies in specific decisions: why ripgrep's defaults encode years of experience into a single invocation, how fd made opinionated choices that turned out to be right for most people most of the time, how bat stays composable while adding capabilities that lesser tools would use to break composability.
If you've been building Rust CLI tools and something keeps going wrong in ways you can't fully articulate—if your tools work until they're in someone else's hands, or compose until they're in a real pipeline, or perform well until they're on real data—this is the book that names the problem and works through the fix. Not in theory. In the specific, unglamorous detail that real tools require.
"About this title" may belong to another edition of this title.
Returns Policy
We ask all customers to contact us for authorisation should they wish to return their order. Orders returned without authorisation may not be credited.
If you wish to return, please contact us within 14 days of receiving your order to obtain authorisation.
Returns requested beyond this time will not be authorised.
Our team will provide full instructions on how to return your order and once received our returns department will process your refund.
Please note the cost to return any...
If you are a consumer you can cancel the contract in accordance with the following. Consumer means any natural person who is acting for purposes which are outside his trade, business, craft or profession.
INFORMATION REGARDING THE RIGHT OF CANCELLATION
Statutory Right to cancel
You have the right to cancel this contract within 14 days without giving any reason.
The cancellation period will expire after 14 days from the day on which you acquire, or a third party other than the carrier and indicated by you acquires, physical possession of the the last good or the last lot or piece.
To exercise the right to cancel, you must inform us, Paperbackshop-US, 901 Penhorn Avenue, Unit 6, 07094, Secaucus, New Jersey, U.S.A., 44 1285 712917, of your decision to cancel this contract by a clear statement (e.g. a letter sent by post, fax or e-mail). You may use the attached model cancellation form, but it is not obligatory. You can also electronically fill in and submit a clear statement on our website, under "My Purchases" in "My Account". If you use this option, we will communicate to you an acknowledgement of receipt of such a cancellation on a durable medium (e.g. by e-mail) without delay.
To meet the cancellation deadline, it is sufficient for you to send your communication concerning your exercise of the right to cancel before the cancellation period has expired.
Effects of cancellation
If you cancel this contract, we will reimburse to you all payments received from you, including the costs of delivery (except for the supplementary costs arising if you chose a type of delivery other than the least expensive type of standard delivery offered by us).
We may make a deduction from the reimbursement for loss in value of any goods supplied, if the loss is the result of unnecessary handling by you.
We will make the reimbursement without undue delay, and not later than 14 days after the day on which we are informed about your decision to cancel with contract.
We will make the reimbursement using the same means of payment as you used for the initial transaction, unless you have expressly agreed otherwise; in any event, you will not incur any fees as a result of such reimbursement.
We may withhold reimbursement until we have received the goods back or you have supplied evidence of having sent back the goods, whichever is the earliest.
You shall send back the goods or hand them over to us or Paperbackshop-US, PaperbackShopUS, 801 Penhorn Avenue Unit 5, 07094, Secaucus, New Jersey, U.S.A., 44 1285 712917, without undue delay and in any event not later than 14 days from the day on which you communicate your cancellation from this contract to us. The deadline is met if you send back the goods before the period of 14 days has expired. You will have to bear the direct cost of returning the goods. You are only liable for any diminished value of the goods resulting from the handling other than what is necessary to establish the nature, characteristics and functioning of the goods.
Exceptions to the right of cancellation
The right of cancellation does not apply to:
Model withdrawal form
(complete and return this form only if you wish to withdraw from the contract)
To: (Paperbackshop-US, 901 Penhorn Avenue, Unit 6, 07094, Secaucus, New Jersey, U.S.A., 44 1285 712917)
I/We (*) hereby give notice that I/We (*) withdraw from my/our (*) contract of sale of the following goods (*)/for the provision of the following goods (*)/for the provision of the following service (*),
Ordered on (*)/received on (*)
Name of consumer(s)
Address of consumer(s)
Signature of consumer(s) (only if this form is notified on paper)
Date
* Delete as appropriate.
Books are shipped from our US or UK warehouses. Delivery estimates allow for delivery from either location.
| Order quantity | 7 to 14 business days | 7 to 14 business days |
|---|---|---|
| First item | £ 0.00 | £ 0.00 |
Delivery times are set by sellers and vary by carrier and location. Orders passing through Customs may face delays and buyers are responsible for any associated duties or fees. Sellers may contact you regarding additional charges to cover any increased costs to ship your items.