baloodb: Improve interface
AcceptedPublic

Authored by michaelh on Apr 8 2018, 12:13 PM.

Details

Reviewers
ngraham
Group Reviewers
Baloo
Maniphest Tasks
T8250: Sanitize the database
Summary
  • Colorize output
  • Improve help message
Test Plan
$ baloodb 

Diff Detail

Repository
R293 Baloo
Branch
sanitize-improve-ui (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
michaelh created this revision.Apr 8 2018, 12:13 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptApr 8 2018, 12:13 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
michaelh requested review of this revision.Apr 8 2018, 12:13 PM

This is the last patch, before I let baloodb rest for some time.

This is the first time I've created a cli-tool + class completely from scratch. So there a tendency to become routine-blinded ("betriebsblind"). Therefore I'd like to ask you to check for

  • overall consistency
  • proper wording
  • expressiveness of names: commands, command options, functions, variables.
  • usefulness of coloring

command options:

  • -D is fixed
  • -d is forbidden to avoid confusion
  • -o is reserved for maybe --output

Everything else is completely changeable.
I'm looking forward to your comments and suggestions.

To see this at work you can ruin your database as described in T7860 or do

$ md /tmp/otto

Copy some files into /tmp/otto

$ balooctl index /tmp/otto/*
$ balooctl stop
$ rm /tmp/otto/*

baloodb works without the indexer running.

bruns added a subscriber: bruns.Apr 8 2018, 3:13 PM
bruns added inline comments.
src/engine/databasesanitizer.cpp
249–253 ↗(On Diff #31684)

code uniformity - I prefer it as written in line 285 (acessible check first)

323–324 ↗(On Diff #31684)

long line, remove the format string and use operator<< for each argument

src/engine/databasesanitizer.h
85 ↗(On Diff #31684)

Instead of the outermost pair, just use a plain array - the types of all elements are uniform

michaelh updated this revision to Diff 31684.Apr 8 2018, 3:46 PM
michaelh edited the summary of this revision. (Show Details)
  • Apply suggested changes
michaelh marked 3 inline comments as done.Apr 8 2018, 3:47 PM
ngraham accepted this revision as: ngraham.Apr 8 2018, 8:58 PM

Very nice, I like it. This is a very handy tool now.

This revision is now accepted and ready to land.Apr 8 2018, 8:58 PM
michaelh planned changes to this revision.Apr 14 2018, 11:15 AM
This revision is now accepted and ready to land.Apr 15 2018, 7:27 PM